/**
 * GreyHelixIT PGP Encryptor - Stylesheet
 * Dark theme based on globals.css design system
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables */
:root {
    --color-bg:         #151c21;
    --color-surface:    #2c343a;
    --color-border:     #3d4d56;
    --color-muted:      #6c7a80;
    --color-text:       #e8eaec;
    --color-text-dim:   #9ba8b0;
    --color-accent:     #22d3ee;
    --color-accent-dim: #0e7490;

    --font-heading: 'Montserrat', Arial, sans-serif;
    --font-body:    'Inter', Helvetica, Arial, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    --danger-color: #f87171;
    --success-color: #4ade80;
    --warning-color: #fbbf24;

    --shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image:
        linear-gradient(rgba(108, 122, 128, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 122, 128, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

/* Header Styles */
header {
    background: var(--color-bg);
    color: var(--color-text);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

header::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Logo Styles */
.logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 1rem;
}

header h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--color-accent);
    text-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subtitle {
    font-size: 1rem;
    color: var(--color-text-dim);
    font-weight: 500;
}

/* Disclaimers Section */
.disclaimers {
    padding: 2rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.disclaimer {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 3px solid;
    background: var(--color-surface);
}

.disclaimer:last-child {
    margin-bottom: 0;
}

.disclaimer.info {
    border-left-color: var(--color-accent);
}

.disclaimer.purpose {
    border-left-color: var(--warning-color);
}

.disclaimer strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

/* Section Styles */
section {
    padding: 2rem;
    border-bottom: 1px solid var(--color-border);
}

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

h2 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Public Key Section */
.public-key-section {
    background: var(--color-bg);
    text-align: center;
}

.key-info {
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    background: var(--color-surface);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    display: inline-block;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.key-expiration {
    font-size: 0.95rem;
}

.key-expiration strong {
    color: var(--color-accent);
}

#keyExpirationDate {
    font-weight: 500;
    color: var(--color-text);
}

.btn-download {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: var(--color-accent);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--color-accent);
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.btn-download:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.3);
}

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--color-bg);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--color-accent);
    background: rgba(34, 211, 238, 0.05);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.drop-zone h3 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--color-text-dim);
    margin: 0.5rem 0;
}

.help-text {
    font-size: 0.9rem;
    margin-top: 1rem;
    color: var(--color-muted);
}

/* Button Styles */
.btn-primary,
.btn-encrypt,
.btn-secondary {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-bg);
    border: 1px solid var(--color-accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-accent);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
}

.btn-encrypt {
    background: var(--color-accent);
    color: var(--color-bg);
    margin-right: 1rem;
}

.btn-encrypt:hover {
    background: var(--color-accent-dim);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
    color: var(--color-text);
}

.btn-encrypt:disabled {
    background: var(--color-muted);
    color: var(--color-bg);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-dim);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-text-dim);
    color: var(--color-text);
}

/* File List Styles */
.file-list {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-bg);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.file-list.hidden {
    display: none;
}

#fileListItems {
    list-style: none;
    margin: 1rem 0;
}

#fileListItems li {
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.file-name {
    font-weight: 500;
    flex: 1;
    color: var(--color-text);
}

.file-size {
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-left: 1rem;
}

.file-remove {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-body);
    margin-left: 1rem;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: var(--danger-color);
    color: var(--color-bg);
}

/* Progress Section */
.progress-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-bg);
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.progress-section.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid var(--color-border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-dim) 0%, var(--color-accent) 100%);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg);
    font-weight: 700;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

#progressText {
    text-align: center;
    color: var(--color-text-dim);
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(74, 222, 128, 0.05);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--success-color);
    border-radius: 6px;
}

.results-section.hidden {
    display: none;
}

#resultsContent {
    margin-top: 1rem;
}

.result-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.result-item.success {
    color: var(--success-color);
}

.result-item.error {
    color: var(--danger-color);
}

/* Instructions Section */
.instructions {
    background: var(--color-bg);
}

.instructions ol {
    margin-left: 1.5rem;
    color: var(--color-text-dim);
}

.instructions li {
    margin-bottom: 0.75rem;
}

.instructions strong {
    color: var(--color-accent);
    font-family: var(--font-heading);
}

.help-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--color-surface);
    border-left: 3px solid var(--warning-color);
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--color-text-dim);
}

/* Footer */
footer {
    background: var(--color-bg);
    color: var(--color-text-dim);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
    position: relative;
}

footer::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.security-note {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-family: var(--font-mono);
    opacity: 0.8;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

    .container {
        border-radius: 6px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    section {
        padding: 1.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .btn-encrypt {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
    }

    #fileListItems li {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-size,
    .file-remove {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

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

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.file-list,
.progress-section,
.results-section {
    animation: fade-up 0.4s ease both;
}
