/**
 * Mecc Alte Tools - Shared Styles
 * Common CSS variables, resets, and reusable component styles.
 */

@import url('./fonts.css');

/* ===== CSS Custom Properties ===== */
:root {
    /* Brand Colors */
    --color-primary-dark: #004990;
    --color-primary-medium: #005a8b;
    --color-accent-teal: #35c4b5;
    --color-accent-orange: #ff6d42;
    --color-accent-yellow: #ffcb4f;
    --color-neutral-gray: #8996a0;
    --color-dark-text: #1a2732;
    --color-medium-text: #394a58;
    --color-teal-dark: #006d68;
    --color-blue-deep: #007c92;

    /* Background Colors */
    --color-bg-light: #f0f4f8;
    --color-bg-blue-light: #e7f3ff;
    --color-bg-green-light: #f0faf8;
    --color-bg-white: #ffffff;
    --color-bg-gray-light: #dae3ea;
    --color-bg-yellow-light: #fff8e6;

    /* Common Values */
    --border-radius-sm: 8px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 18px;
    --shadow-sm: 0 2px 9px rgba(0, 73, 144, 0.09);
    --shadow-md: 0 4px 14px rgba(0, 90, 139, 0.12);
    --shadow-lg: 0 8px 26px rgba(0, 124, 146, 0.14);
    --shadow-xl: 0 12px 36px rgba(0, 73, 144, 0.08);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Panton', 'Arial', sans-serif;
    background: linear-gradient(120deg, var(--color-bg-white) 0%, var(--color-bg-light) 100%);
    min-height: 100vh;
    padding: 0px;
}

/* Brand typography: Klavika for headings/key messaging, Panton for body copy */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Klavika', 'Arial', sans-serif;
    letter-spacing: 0.02em;
}

/* Brand link colors */
a {
    color: var(--color-primary-dark);
    transition: color 0.2s;
}
a:hover {
    color: var(--color-accent-teal);
}

/* Brand horizontal rule */
hr {
    border: none;
    border-top: 2px solid var(--color-accent-teal);
    margin: 20px 0;
    opacity: 0.4;
}

/* ===== Privacy Modal (shared between login and index) ===== */
.privacy-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.privacy-modal-overlay[aria-hidden="false"] {
    display: flex;
}

.privacy-modal-content {
    background: var(--color-bg-white);
    border-radius: var(--border-radius-lg);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.privacy-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-neutral-gray);
    background: none;
    border: none;
    line-height: 1;
}

.privacy-modal-close:hover {
    color: var(--color-primary-dark);
}

.privacy-modal-content h2 {
    margin: 0 0 20px 0;
    color: var(--color-primary-dark);
}

.privacy-intro {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.privacy-section {
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    padding: 18px;
    margin-bottom: 12px;
}

.privacy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.privacy-header h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--color-primary-dark);
}

.privacy-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.privacy-section p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
}

/* Toggle Switch */
.privacy-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-block;
    flex-shrink: 0;
}

.privacy-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.privacy-toggle input:checked + .toggle-slider {
    background-color: var(--color-accent-teal);
}

.privacy-toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Focus visible for accessibility */
.privacy-toggle input:focus-visible + .toggle-slider {
    outline: 2px solid var(--color-primary-dark);
    outline-offset: 2px;
}

.privacy-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.privacy-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
    min-width: 120px;
    font-size: 0.95em;
    transition: opacity 0.3s;
}

.privacy-btn:hover {
    opacity: 0.9;
}

.privacy-btn-reject {
    background: #f5f5f5;
    color: #666;
}

.privacy-btn-accept-all {
    background: #6c757d;
    color: white;
}

.privacy-btn-save {
    background: var(--color-primary-dark);
    color: white;
}

.privacy-footer-text {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: #666;
}

.privacy-footer-text a {
    color: var(--color-primary-dark);
}

/* ===== Cookie Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: var(--color-accent-teal);
}

.cookie-banner-text p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: #ccc;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-cookie {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-cookie-accept {
    background: var(--color-accent-teal);
    color: #fff;
}

.btn-cookie-accept:hover {
    background: #2aa89b;
}

.btn-cookie-reject {
    background: transparent;
    color: #fff;
    border: 2px solid #666;
}

.btn-cookie-reject:hover {
    border-color: #fff;
}

.btn-cookie-settings {
    background: transparent;
    color: var(--color-accent-teal);
    border: 2px solid var(--color-accent-teal);
}

.btn-cookie-settings:hover {
    background: rgba(53, 196, 181, 0.1);
}

/* ===== Toast notification ===== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary-dark);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    animation: fadeIn 0.3s ease-out;
}

/* ===== Responsive - Base ===== */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
}

/* ===== Responsive - Privacy ===== */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner-buttons {
        width: 100%;
        justify-content: center;
    }

    .privacy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .privacy-toggle {
        align-self: flex-end;
    }

    .privacy-actions {
        flex-direction: column;
    }

    .privacy-actions button {
        width: 100%;
    }
}
