/**
 * Secure Notes - Modern CSS Design
 *
 * Dark mode (default) and Light mode support with gradients
 *
 * @version 2.0.0
 */

/* ========================================
   CSS Variables & Base Styles
   ======================================== */

:root {
    --transition-speed: 0.3s;
    --border-radius: 0.75rem;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

* {
    transition: background-color var(--transition-speed),
                color var(--transition-speed),
                border-color var(--transition-speed),
                box-shadow var(--transition-speed);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* ========================================
   Dark Mode (Default) - Modern Design
   ======================================== */

body.dark-mode {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    color: #e8e8e8;
}

.dark-mode .card {
    background: linear-gradient(145deg, #2a2a3e 0%, #1f1f2e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
    backdrop-filter: blur(10px);
}

.dark-mode .card-body {
    background: transparent;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
    backdrop-filter: blur(10px);
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #4a9eff;
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(74, 158, 255, 0.15),
                0 4px 12px rgba(74, 158, 255, 0.2);
}

.dark-mode .form-select option {
    background: #1f1f2e;
    color: #e8e8e8;
}

.dark-mode .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.dark-mode .form-control:disabled,
.dark-mode .form-control[readonly] {
    background-color: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
}

.dark-mode .bg-light {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e8e8e8 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.dark-mode .form-text {
    color: rgba(255, 255, 255, 0.6);
}

.dark-mode .border {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .card.bg-dark {
    background: linear-gradient(145deg, #16213e 0%, #0f1419 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode .footer.bg-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f0f 100%) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .alert-info {
    background: linear-gradient(135deg, #1a3a52 0%, #0d2a42 100%);
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: #a3d5ff;
}

.dark-mode .alert-success {
    background: linear-gradient(135deg, #1a4d2e 0%, #0d3d1e 100%);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #86efac;
}

.dark-mode .alert-warning {
    background: linear-gradient(135deg, #5d4a1a 0%, #4d3a0a 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

.dark-mode .alert-danger {
    background: linear-gradient(135deg, #5d1a1a 0%, #4d0a0a 100%);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

/* Modern Button Gradients - Dark Mode */
.dark-mode .btn-primary {
    background: linear-gradient(135deg, #4a9eff 0%, #2563eb 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #5fadff 0%, #3b82f6 100%);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
    transform: translateY(-1px);
}

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

.dark-mode .btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.dark-mode .btn-success:hover {
    background: linear-gradient(135deg, #86efac 0%, #22c55e 100%);
    box-shadow: 0 6px 16px rgba(74, 222, 128, 0.4);
    transform: translateY(-1px);
}

.dark-mode .btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

.dark-mode .btn-danger:hover {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
    box-shadow: 0 6px 16px rgba(248, 113, 113, 0.4);
    transform: translateY(-1px);
}

.dark-mode .btn-outline-secondary {
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
}

.dark-mode .btn-outline-secondary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.dark-mode .btn-outline-light {
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .btn-outline-light:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* File Input Button - Dark Mode */
.dark-mode .form-control[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #4a9eff 0%, #2563eb 100%);
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    transition: all 0.3s ease;
}

.dark-mode .form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #5fadff 0%, #3b82f6 100%);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
    transform: translateY(-1px);
}

.dark-mode .input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

.dark-mode .progress {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .progress-bar {
    background: linear-gradient(90deg, #4a9eff 0%, #2563eb 100%);
}

.dark-mode .badge {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .navbar-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-mode .form-check-input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .form-check-input:checked {
    background: linear-gradient(135deg, #4a9eff 0%, #2563eb 100%);
    border-color: #4a9eff;
}

/* Accordion - Dark Mode */
.dark-mode .accordion-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.dark-mode .accordion-button {
    background: rgba(255, 255, 255, 0.05);
    color: #e8e8e8;
    border: none;
    font-weight: 500;
}

.dark-mode .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    color: #4a9eff;
    box-shadow: none;
}

.dark-mode .accordion-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dark-mode .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(74, 158, 255, 0.15);
    border-color: transparent;
}

.dark-mode .accordion-button::after {
    filter: brightness(0) invert(1);
}

.dark-mode .accordion-body {
    background: rgba(255, 255, 255, 0.02);
    color: #e8e8e8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Light Mode - Modern Design
   ======================================== */

body.light-mode {
    background: linear-gradient(135deg, #f0f4f8 0%, #e6f2ff 100%);
    color: #1e293b;
}

.light-mode .card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.light-mode .card-body {
    background: transparent;
}

.light-mode .form-control,
.light-mode .form-select {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.light-mode .form-control:focus,
.light-mode .form-select:focus {
    background: #ffffff;
    border-color: #4a9eff;
    color: #1e293b;
    box-shadow: 0 0 0 0.25rem rgba(74, 158, 255, 0.1),
                0 4px 12px rgba(74, 158, 255, 0.15);
}

.light-mode .form-control::placeholder {
    color: #94a3b8;
}

.light-mode .form-control:disabled,
.light-mode .form-control[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
}

.light-mode .bg-light {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: #1e293b !important;
    border-color: #e2e8f0 !important;
}

.light-mode .text-muted {
    color: #64748b !important;
}

.light-mode .form-text {
    color: #64748b;
}

.light-mode .border {
    border-color: #e2e8f0 !important;
}

.light-mode .card.bg-dark {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .card.bg-dark .card-body {
    background: transparent !important;
    color: #ffffff !important;
}

.light-mode .navbar-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light-mode .footer.bg-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
}

/* Modern Button Gradients - Light Mode */
.light-mode .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.light-mode .btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

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

.light-mode .btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.light-mode .btn-success:hover {
    background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

.light-mode .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.light-mode .btn-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.light-mode .btn-outline-secondary {
    color: #64748b;
    border: 1px solid #cbd5e1;
    background: transparent;
}

.light-mode .btn-outline-secondary:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #94a3b8;
    color: #475569;
}

.light-mode .btn-outline-light {
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.light-mode .btn-outline-light:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #94a3b8;
    color: #475569;
}

/* File Input Button - Light Mode */
.light-mode .form-control[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.light-mode .form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.light-mode .input-group-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.light-mode .progress {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.light-mode .progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Accordion - Light Mode */
.light-mode .accordion-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
}

.light-mode .accordion-button {
    background: #f8fafc;
    color: #1e293b;
    border: none;
    font-weight: 500;
}

.light-mode .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
    color: #3b82f6;
    box-shadow: none;
}

.light-mode .accordion-button:hover {
    background: #f1f5f9;
}

.light-mode .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.15);
    border-color: transparent;
}

.light-mode .accordion-body {
    background: #ffffff;
    color: #1e293b;
    border-top: 1px solid #e2e8f0;
}

/* ========================================
   Custom Component Styles
   ======================================== */

.font-monospace {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.card {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.card.shadow {
    box-shadow: var(--shadow-lg) !important;
}

/* Primary colored elements (for About page) */
.bg-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.dark-mode .bg-primary {
    background: linear-gradient(135deg, #4a9eff 0%, #2563eb 100%) !important;
}

.light-mode .bg-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
}

.bg-primary.text-white .btn-light {
    background: #ffffff;
    color: #3b82f6;
    border: none;
}

.bg-primary.text-white .btn-light:hover {
    background: #f8fafc;
    color: #2563eb;
}

.dark-mode .bg-primary.text-white .btn-light {
    background: #ffffff;
    color: #4a9eff;
}

.dark-mode .bg-primary.text-white .btn-light:hover {
    background: #f1f5f9;
    color: #5fadff;
}

.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
    border-radius: 0.625rem;
}

.form-control,
.form-select {
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 200px;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand svg {
    vertical-align: middle;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.footer {
    padding: 1.5rem 0;
}

.progress {
    height: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    font-size: 0.875rem;
    line-height: 1.5rem;
}

.alert {
    border-radius: 0.625rem;
    backdrop-filter: blur(10px);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* File info section */
#fileInfo {
    padding: 0.75rem;
    background: rgba(74, 158, 255, 0.08);
    border-radius: 0.5rem;
    border: 1px solid rgba(74, 158, 255, 0.2);
}

/* Collapsible sections */
.collapse {
    transition: height 0.35s ease;
}

/* Character counter */
.form-text {
    font-size: 0.875rem;
    margin-top: 0.375rem;
}

/* Generated password display */
#generatedPassword {
    border-radius: 0.5rem;
}

#generatedPassword strong {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.1rem;
}

/* Note content display */
#decryptedContent {
    min-height: 100px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Loading states */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .h3 {
        font-size: 1.5rem;
    }

    .h4 {
        font-size: 1.25rem;
    }
}

/* Security-themed icons */
.bi-shield-lock,
.bi-lock-fill {
    vertical-align: middle;
    display: inline-block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Copy feedback animation */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

#copyFeedback {
    animation: fadeInOut 3s ease-in-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 3px;
    border-radius: 0.25rem;
}

/* Custom scrollbar - Dark Mode */
.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.5) 0%, rgba(37, 99, 235, 0.5) 100%);
    border-radius: 5px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.7) 0%, rgba(37, 99, 235, 0.7) 100%);
}

/* Custom scrollbar - Light Mode */
.light-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.light-mode ::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.light-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 5px;
}

.light-mode ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    #themeToggle {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }
}
