:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --dark: #1e293b;
    --light: #f8fafc;
    --accent: #22d3ee;
    --text: #334155;
    --bg: #f1f5f9;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 20px 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

header h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tab Styles */
.tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--secondary);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn:hover {
    background: var(--light);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Theory Section Styles */
h2 {
    color: var(--dark);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
}

h3 {
    color: var(--primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
}

p {
    margin-bottom: 1rem;
}

ul {
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Example Box */
.example-box {
    background: var(--light);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.example-box strong {
    color: var(--dark);
    display: block;
    margin-bottom: 0.5rem;
}

.code {
    background: var(--dark);
    color: var(--light);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 1rem 0;
    overflow-x: auto;
    white-space: pre-wrap;
}

code {
    background: var(--light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
}

/* Tool Section Styles */
.tool-section {
    background: var(--light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-section h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--secondary);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.5);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.02);
}

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

/* Image Preview */
#encryptImagePreview,
#decryptImagePreview {
    margin: 1.5rem 0;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Textarea Styles */
textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin: 0.5rem 0 1rem 0;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.char-limit {
    text-align: right;
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Button Styles */
button {
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#encryptBtn,
#decryptBtn {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

#encryptBtn:hover:not(:disabled),
#decryptBtn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#encryptBtn:disabled,
#decryptBtn:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Message Display */
#encryptMessage,
#decryptMessage,
#extractedMessage {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.message-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Preview Sections */
#encryptPreview,
#decryptPreview {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    .tool-section {
        padding: 1.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }
    
    header {
        padding: 1rem 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .tool-section {
        padding: 1rem;
    }
    
    .example-box {
        padding: 1rem;
    }
    
    .code {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* No JavaScript Fallback */
.no-js .tab-content,
.no-js .tool-section {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transitions for interactive elements */
.btn, .tab-btn, .upload-area, #encryptBtn, #decryptBtn {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
button:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.download-pptx-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-pptx-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.download-pptx-btn:active {
    transform: translateY(0);
}
.download-docx-btn {
    position: fixed;
    top: 80px; /* placed below the PPTX button */
    right: 20px;
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-docx-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.6);
}

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