/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #F8F1E6;
    min-height: 100vh;
    padding: 20px;
    color: #3b3f44;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: #3b3f44;
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
}

.header-logo {
    margin-bottom: 20px;
}

.header-logo .logo {
    max-width: 200px;
    height: auto;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 15px;
    opacity: 0.85;
    color: #F8F1E6;
    font-weight: 400;
}

/* Main Content */
main {
    padding: 40px;
}

/* Password Section */
.password-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-weight: 600;
    color: #3b3f44;
    font-size: 15px;
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #41986b;
}

.input-group button {
    margin-top: 8px;
}

.help-text {
    margin-top: 12px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    text-align: center;
}

/* Upload Section */
.upload-section {
    max-width: 700px;
    margin: 0 auto;
}

.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.drop-zone:hover {
    border-color: #41986b;
    background: #eef5f1;
}

.drop-zone.drag-over {
    border-color: #41986b;
    background: #dff0e8;
    transform: scale(1.02);
}

.drop-zone-content svg {
    color: #41986b;
    margin-bottom: 20px;
}

.drop-zone-text {
    font-size: 18px;
    font-weight: 600;
    color: #3b3f44;
    margin-bottom: 8px;
}

.drop-zone-subtext {
    font-size: 14px;
    color: #6c757d;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* File Info */
.file-info {
    background: #dff0e8;
    border: 2px solid #41986b;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info p {
    font-weight: 600;
    color: #358a5f;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 60px 40px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #41986b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingMessage {
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

/* Preview Section */
.preview-section {
    max-width: 100%;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.preview-header h2 {
    font-size: 24px;
    color: #3b3f44;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.preview-container {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    margin-bottom: 20px;
}

#emailPreview {
    width: 100%;
    height: 600px;
    border: none;
}

.preview-footer {
    text-align: center;
    padding-top: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #41986b 0%, #358a5f 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(65, 152, 107, 0.4);
}

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

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-text {
    background: none;
    border: none;
    color: #41986b;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.btn-text:hover {
    color: #358a5f;
}

/* Display utilities */
.hidden {
    display: none !important;
}

/* Messages */
.success-message,
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: #3b3f44;
    color: #F8F1E6;
    padding: 20px 40px;
    text-align: center;
    font-size: 13px;
    border-top: 3px solid #41986b;
}

footer p {
    margin: 0;
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 25px 20px;
    }

    .header-logo .logo {
        max-width: 160px;
    }

    header h1 {
        font-size: 22px;
    }

    .subtitle {
        font-size: 14px;
    }

    main {
        padding: 20px;
    }

    .password-section {
        padding: 20px;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .preview-actions {
        width: 100%;
        flex-direction: column;
    }

    .preview-actions .btn {
        width: 100%;
    }

    #emailPreview {
        height: 500px;
    }

    footer {
        padding: 15px 20px;
        font-size: 12px;
    }
}
