/* Logo Generator - Notion-like UI */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: rgb(25, 25, 24);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
    padding: 32px 20px;
}

* {
    font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

:root {
    --font-sans: "Inter", sans-serif;
    --text-color: rgb(25, 25, 24);
    --bg-color: #fafafa;
    --border-color: rgba(55, 53, 47, 0.12);
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-32) var(--space-24);
}

/* ========== APP HEADER ========== */
.app-header {
    text-align: center;
    margin-bottom: var(--space-24);
    padding: var(--space-16) var(--space-24);
    margin: calc(-1 * var(--space-32)) calc(-1 * var(--space-24)) var(--space-24);
}

.app-header__title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-color);
    margin: 0;
    padding-bottom: var(--space-16);
}

.app-header__title::after {
    content: "";
    display: block;
    width: 40%;
    height: 1px;
    background: var(--border-color);
    margin: var(--space-16) auto 0;
}

/* Input Section */
.input-section {
    margin-bottom: 32px;
}

.input-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-24) var(--space-16);
    }

    .app-header {
        padding: var(--space-12) var(--space-16);
        margin: calc(-1 * var(--space-24)) calc(-1 * var(--space-16)) var(--space-20);
    }

    .app-header__title {
        font-size: 28px;
    }

    .input-row {
        grid-template-columns: 1fr;
    }
}

.input-wrapper {
    margin-bottom: 0;
}

.input-wrapper:not(.checkbox-wrapper) {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(25, 25, 24, 0.6);
    margin-bottom: 8px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: rgb(25, 25, 24);
    background: rgba(55, 53, 47, 0.04);
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input[type="text"]:focus,
textarea:focus {
    border-color: #2383E2;
    background: white;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: rgba(25, 25, 24, 0.4);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    padding-top: 32px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: rgb(25, 25, 24);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2383E2;
}

/* Buttons */
.button-row {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 50px;
    background: #000000;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: #1a1a1a;
}

.btn-primary:active:not(:disabled) {
    background: #333333;
}

.btn-primary:disabled {
    background: rgba(35, 131, 226, 0.5);
    cursor: not-allowed;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    background: white;
    color: rgb(25, 25, 24);
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(55, 53, 47, 0.08);
}

.btn-secondary svg {
    width: 20px;
    height: 20px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 8px;
    background: white;
    color: rgb(25, 25, 24);
    border: 0.5px solid rgba(55, 53, 47, 0.16);
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-outline:hover {
    background: rgba(55, 53, 47, 0.08);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 48px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.spinner-container {
    margin-bottom: 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(35, 131, 226, 0.1);
    border-top-color: #2383E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    font-weight: 500;
    color: rgb(25, 25, 24);
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: rgba(25, 25, 24, 0.6);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 48px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: #e74c3c;
}

.error-text {
    font-size: 16px;
    color: rgb(25, 25, 24);
    margin-bottom: 24px;
}

/* Result Section */
.result-section {
    margin-top: 48px;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-title {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    color: rgb(25, 25, 24);
}

.result-subtitle {
    font-size: 16px;
    color: rgba(25, 25, 24, 0.6);
}

.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .logos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

.logo-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.logo-card.error {
    border: 0.5px solid #e74c3c;
    opacity: 0.7;
}

.logo-image-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(55, 53, 47, 0.04);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.logo-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-style-name {
    font-size: 16px;
    font-weight: 600;
    color: rgb(25, 25, 24);
    margin-bottom: 4px;
}

.logo-style-description {
    font-size: 14px;
    color: rgba(25, 25, 24, 0.6);
    line-height: 1.4;
}

.logo-error {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    font-size: 14px;
}

.result-actions {
    text-align: center;
    margin-top: 32px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    margin: 5% auto;
    padding: 32px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 32px;
    font-weight: 300;
    color: rgba(25, 25, 24, 0.6);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: rgb(25, 25, 24);
}

.modal-header {
    margin-bottom: 24px;
    padding-right: 40px;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgb(25, 25, 24);
}

.modal-header p {
    font-size: 16px;
    color: rgba(25, 25, 24, 0.6);
    line-height: 1.5;
}

.modal-image-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(55, 53, 47, 0.04);
    border-radius: 8px;
    margin-bottom: 24px;
    padding: 32px;
    overflow: hidden;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn-primary,
.modal-actions .btn-outline {
    flex: 1;
    max-width: 200px;
}
