@import url('assets/colors.css');

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

body {
    font-family: 'Futura', 'Trebuchet MS', sans-serif;
    background: var(--background, #111111); /* SlateBackground dark mode */
    min-height: 100vh;
    padding: 4rem 1rem 2rem 1rem;
    color: var(--text-primary, #fafafa); /* SlateText dark mode */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

.site-header {
    text-align: center;
    margin-bottom: 1rem;
}

.site-logo {
    height: 60px;
    width: auto;
}

h1 {
    font-size: 2.5rem;
    color: var(--text-primary, #fafafa); /* SlateText */
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary, #999999); /* SlateSecondary */
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Demo Mode Notice */
.demo-notice {
    margin-bottom: 2rem;
}

.demo-notice-content {
    background: var(--slate-accent, #fafafa);
    color: var(--slate-accent-contrast, #111111);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(var(--slate-accent-rgb, 250, 250, 250), 0.18);
}

.demo-icon {
    font-size: 1.2rem;
}

.demo-text {
    flex: 1;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.theme-btn {
    background: var(--card-background, #1e1e1e);
    border: 1px solid var(--slate-border, rgba(255, 255, 255, 0.1));
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary, #fafafa);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--slate-hover, rgba(255, 255, 255, 0.08));
    border-color: var(--slate-accent, #fafafa);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-text {
    font-weight: 500;
}

.main-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 2rem;
    align-items: start;
}

.form-container {
    background: var(--card-background, #1e1e1e); /* SlateCard */
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 3rem;
}

.preview-container {
    position: sticky;
    top: 2rem;
}

.preview-sticky {
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Apple Wallet Pass Preview */
.apple-wallet-pass {
    background: linear-gradient(135deg, #2b2b2b 0%, #2b2b2b 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pass-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.pass-icon {
    width: 29px;
    height: 29px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pass-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-placeholder {
    font-size: 18px;
}

.pass-logo-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.pass-strip {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.pass-strip img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.strip-placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.pass-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pass-field {
    margin-bottom: 8px;
}

.pass-field-value {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pass-field-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.pass-barcode {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
}

.barcode-placeholder {
    width: 120px;
    height: 120px;
}

.barcode-text {
    color: #333;
    font-size: 11px;
    text-align: center;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
}

h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #666666; /* SlateSecondary */
}

.section:last-of-type {
    border-bottom: none;
}

h2 {
    font-size: 1.5rem;
    color: #fafafa; /* SlateText */
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fafafa; /* SlateText */
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #666666; /* SlateSecondary in light mode */
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f2f2f2; /* SlateCard in light mode */
    color: #111111; /* SlateText in light mode */
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus {
    outline: none;
    border-color: var(--slate-accent, #fafafa);
    box-shadow: 0 0 0 3px rgba(var(--slate-accent-rgb, 250, 250, 250), 0.12);
    background: #ffffff;
}

input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed #666666; /* SlateSecondary */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f2f2f2; /* SlateCard */
    color: #111111; /* SlateText */
}

input[type="file"]:hover {
    border-color: var(--slate-accent, #fafafa);
    background: rgba(var(--slate-accent-rgb, 250, 250, 250), 0.08);
}

.color-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

input[type="color"] {
    width: 80px;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 4px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-input-group input[type="text"] {
    flex: 1;
}

.help-text {
    font-size: 0.85rem;
    color: #999999; /* SlateSecondary */
    margin-top: 0.5rem;
    line-height: 1.4;
}

.center-text {
    text-align: center;
}

.image-preview {
    margin-top: 1rem;
    min-height: 100px;
    border: 2px dashed #666666; /* SlateSecondary */
    border-radius: 8px;
    display: none;
    background: #f2f2f2; /* SlateCard */
}
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f9f9f9;
}

.image-preview.active {
    display: flex;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
}

.preview-section {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    padding: 2rem;
    border-radius: 12px;
}

.preview-card {
    background: var(--preview-bg, #1a1a1a);
    color: var(--preview-fg, #ffffff);
    border-radius: 16px;
    padding: 2rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.preview-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.preview-brand {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.preview-logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.logo-placeholder {
    font-size: 2rem;
    font-weight: bold;
    opacity: 0.5;
    text-align: center;
}

.preview-logo img {
    max-width: 80%;
    max-height: 120px;
    object-fit: contain;
}

.preview-name {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
}

.preview-title {
    font-size: 1rem;
    text-align: center;
    opacity: 0.8;
    color: var(--preview-label, #999999);
}

.submit-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    background: #a3a3a2;
    color: #2b2b2b !important;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(163, 163, 162, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163, 163, 162, 0.6);
    background: var(--slate-accent, #fafafa);
    color: var(--slate-accent-contrast, #111111) !important;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-block;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #1e1e1e; /* SlateCard */
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #fafafa; /* SlateText */
}

.modal-content > p {
    text-align: center;
    color: #999999; /* SlateSecondary */
    margin-bottom: 2rem;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.wallet-badge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.wallet-badge-container a {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.wallet-badge-container a:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.wallet-badge-container img {
    height: 40px;
    width: auto;
}

.download-btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #a3a3a2;
    border: 2px solid #a3a3a2;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn-secondary:hover {
    background: var(--slate-accent, #fafafa);
    color: var(--slate-accent-contrast, #111111);
    border-color: var(--slate-accent, #fafafa);
    transform: translateY(-2px);
}

.link-copy-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pass-link-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: monospace;
    background: #f9f9f9;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: #a3a3a2;
    color: #2b2b2b;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--slate-accent, #fafafa);
    color: var(--slate-accent-contrast, #111111);
}

.copy-btn:active {
    background: #dcdddd;
}

.help-section {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.help-section .help-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.close-btn {
    width: 100%;
    padding: 0.75rem;
    background: #dcdddd;
    color: #2b2b2b;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #a3a3a2;
}

/* Saved Passes Section */
.save-pass-btn {
    width: 100%;
    padding: 0.75rem;
    background: #a3a3a2;
    color: #2b2b2b !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(163, 163, 162, 0.3), 0 1px 4px rgba(0, 0, 0, 0.1);
}

.save-pass-btn:hover {
    background: var(--slate-accent, #fafafa);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(163, 163, 162, 0.3);
    color: var(--slate-accent-contrast, #111111) !important;
}

.saved-pass-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #1e1e1e; /* SlateCard */
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 2px solid #666666; /* SlateSecondary */
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.saved-pass-item:hover {
    border-color: var(--slate-accent, #fafafa);
    box-shadow: 0 4px 12px rgba(var(--slate-accent-rgb, 250, 250, 250), 0.14);
    transform: translateY(-2px);
}

.saved-pass-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.saved-pass-info strong {
    font-size: 1rem;
    color: #fafafa; /* SlateText */
}

.saved-pass-info span {
    font-size: 0.9rem;
    color: #999999; /* SlateSecondary */
}

.saved-pass-info small {
    font-size: 0.8rem;
    color: #666666; /* SlateSecondary */
}

.saved-pass-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.load-btn, .delete-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-btn {
    background: #a3a3a2;
    color: #2b2b2b;
}

.load-btn:hover {
    background: var(--slate-accent, #fafafa);
    color: var(--slate-accent-contrast, #111111);
}

.delete-btn {
    background: #666666; /* SlateSecondary */
    color: #fafafa; /* SlateText */
}

.delete-btn:hover {
    background: #999999; /* Darker SlateSecondary */
}
}

@media (max-width: 968px) {
    .page-container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-container {
        padding: 2rem 1.5rem;
    }

    .preview-container {
        position: relative;
        top: 0;
    }

    .color-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    input[type="color"] {
        width: 100%;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .saved-pass-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .saved-pass-actions {
        width: 100%;
    }
    
    .load-btn, .delete-btn {
        flex: 1;
    }
}

/* iPhone specific adjustments for dynamic island and top bar */
@media (max-width: 430px) {
    body {
        padding: 4rem 1rem 2rem 1rem;
    }
    
    .page-container {
        padding: 0.5rem;
    }
}
