/* Base Styles & Variables */
:root {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --secondary-color: #34d399;
    --accent-color: #14b8a6;
    --background: #f9fafb;
    --card-bg: #ffffff;
    --card-hover: #f0fdf4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 2px 12px rgba(16, 185, 129, 0.08);
    --border-radius: 12px;
    --spacing-unit: 8px;
    --input-bg: #f3f4f6;
    --input-hover: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    min-height: 100vh;
}

/* Language Selector */
.language-selector select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

.language-selector select option {
    padding: 6px 10px;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    gap: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.logo i {
    color: var(--primary-color);
    font-size: 24px;
}

nav {
    display: flex;
    gap: 32px;
}

nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    color: #ffffff;
    transform: translateY(-1px);
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    font-weight: 400;
}

/* Converter Container */
.converter-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Upload Section */
.upload-section {
    position: relative;
}

.upload-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.upload-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.upload-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.upload-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 160px;
    height: 44px;
}

.download-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 16px;
    width: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    text-transform: none;
    letter-spacing: 0.3px;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.download-btn:disabled {
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.download-btn i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.download-btn:hover i {
    transform: translateY(-1px);
}

.download-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.download-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.file-input-wrapper {
    position: relative;
    width: 100%;
    margin-top: 8px;
}

input[type="file"] {
    display: none;
}

.btn-primary input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-upload-btn input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-info {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--input-bg);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    font-weight: 500;
}

/* Preview Section */
.preview-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.preview-card:hover {
    border-color: var(--primary-color);
}

.preview-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
}

.preview-header h3 {
    font-size: 18px;
    font-weight: 600;
}

/* Navigation Buttons */
.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.preview-date {
    padding: 8px 16px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 120px;
    text-align: center;
}

.nav-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--input-bg);
    color: var(--text-secondary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

/* Date Display Styling */
#preview-date {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

/* Today Button Styling */
#today-btn {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

#today-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#today-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

#today-btn:disabled {
    background: var(--input-bg);
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Add a subtle animation for the date */
@keyframes fadeIn {
    from { opacity: 0.6; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

#preview-date {
    animation: fadeIn 0.3s ease-out;
}

.icon-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.icon-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.icon-btn:hover:not(:disabled) {
    background: var(--input-bg);
    color: var(--primary-color);
}

.icon-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.preview-events {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.preview-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.btn-download {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-download:disabled {
    background: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-download i {
    font-size: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    padding: 40px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Event Cards */
.event-card {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.event-card:hover {
    border-color: var(--primary-color);
    background: white;
}

.event-time {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.event-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.event-lecturer,
.event-group,
.event-location {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.event-lecturer i,
.event-group i,
.event-location i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

/* Status Messages */
.status-message {
    margin-top: 16px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.status-message.success {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.status-message.error {
    background-color: rgba(255, 59, 48, 0.1);
    color: var(--error-color);
}

/* Info Sections */
.info-section {
    padding: 3rem 1rem;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Privacy Section */
.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    line-height: 1.6;
}

.privacy-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.privacy-content p:last-child {
    margin-bottom: 0;
}

/* How It Works Section */
.info-section {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 0 40px;
}

.info-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    font-weight: 700;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 32px auto 0;
    max-width: 1000px;
    padding: 0 20px;
}

.step {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.step:hover {
    transform: translateY(-4px);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.step p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* Footer */
.app-footer {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    padding: 40px;
    text-align: center;
    margin-top: 80px;
}

.app-footer p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
    font-weight: 500;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-links a i {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .converter-container {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
    
    .steps {
        grid-template-columns: repeat(3, 1fr);
        max-width: 800px;
        gap: 15px;
    }
    
    .preview-card {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .steps {
        grid-template-columns: 1fr;
        max-width: 400px;
        gap: 16px;
    }
    
    .app-header {
        padding: 16px 24px;
    }
    
    .hero {
        padding: 0 24px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .converter-container, .info-section {
        padding: 0 24px;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .upload-card, .preview-card {
        padding: 24px 16px;
    }
    
    .step {
        padding: 24px 16px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* File Info */
.file-info {
    margin-top: 16px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
}

/* Drag and Drop Styles */
.upload-card.drag-over {
    border: 2px dashed var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.upload-card.drag-over .btn-primary {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Custom file input button */
.file-upload-container {
    position: relative;
    width: 100%;
    margin-top: 16px;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.file-upload-btn i {
    font-size: 16px;
}

/* Status message */
.status-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    width: 100%;
    transition: all 0.3s ease;
}

.status-message.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.status-message.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(255, 59, 48, 0.2);
}
