@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* ============================================================
   THEME VARIABLES
   ============================================================ */

:root {
  --card: #ffffff;
  --ring: #34a85a;
  --input: #d4d4d4;
  --muted: #ddd9c4;
  --accent: #66d9ef;
  --border: #d4d4d4;
  --radius: 0.5rem;
  --chart-1: #34a85a;
  --chart-2: #6495ed;
  --chart-3: #66d9ef;
  --chart-4: #ff99cc;
  --chart-5: #33cc33;
  --popover: #ffffff;
  --primary: #34a85a;
  --sidebar: #f9f9fa;
  --font-mono: Source Code Pro, monospace;
  --font-sans: Montserrat, sans-serif;
  --secondary: #6495ed;
  --background: #f9f9fa;
  --font-serif: Playfair Display, serif;
  --foreground: #333333;
  --destructive: #ef4444;
  --shadow-blur: 8px;
  --shadow-color: hsl(0 0% 0%);
  --sidebar-ring: #34a85a;
  --shadow-spread: -1px;
  --shadow-opacity: 0.1;
  --sidebar-accent: #66d9ef;
  --sidebar-border: #d4d4d4;
  --card-foreground: #333333;
  --shadow-offset-x: 0px;
  --shadow-offset-y: 4px;
  --sidebar-primary: #34a85a;
  --muted-foreground: #6e6e6e;
  --accent-foreground: #333333;
  --popover-foreground: #333333;
  --primary-foreground: #ffffff;
  --sidebar-foreground: #333333;
  --secondary-foreground: #ffffff;
  --destructive-foreground: #ffffff;
  --sidebar-accent-foreground: #333333;
  --sidebar-primary-foreground: #ffffff;
  --warning: #f59e0b;
}

.dark {
  --card: #2f3436;
  --ring: #33cc33;
  --input: #444444;
  --muted: #444444;
  --accent: #66d9ef;
  --border: #444444;
  --radius: 0.5rem;
  --chart-1: #33cc33;
  --chart-2: #87ceeb;
  --chart-3: #66d9ef;
  --chart-4: #ff99cc;
  --chart-5: #ffcc00;
  --popover: #2f3436;
  --primary: #33cc33;
  --sidebar: #1a1d23;
  --secondary: #87ceeb;
  --background: #1a1d23;
  --foreground: #e5e5e5;
  --destructive: #ef4444;
  --sidebar-ring: #33cc33;
  --sidebar-accent: #66d9ef;
  --sidebar-border: #444444;
  --card-foreground: #e5e5e5;
  --sidebar-primary: #33cc33;
  --muted-foreground: #a3a3a3;
  --accent-foreground: #000000;
  --popover-foreground: #e5e5e5;
  --primary-foreground: #000000;
  --sidebar-foreground: #e5e5e5;
  --secondary-foreground: #000000;
  --destructive-foreground: #ffffff;
  --sidebar-accent-foreground: #000000;
  --sidebar-primary-foreground: #000000;
  --warning: #fbbf24;
}

/* ============================================================
   BASE
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    min-height: 100vh;
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   NAVIGATION BAR (Standard für alle Seiten)
   ============================================================ */

.lang-change-bar {
    padding: 8px 16px;
    background-color: var(--card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.change-language-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.change-language-btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 8px 12px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.current-flag {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

.container {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
}

/* ============================================================
   LOGIN (unused but kept for compatibility)
   ============================================================ */

.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--background);
}

.login-box {
    background: var(--card);
    padding: 40px;
    border-radius: calc(var(--radius) * 2);
    box-shadow: var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur) rgba(0,0,0,var(--shadow-opacity));
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border);
}

.login-box h1 {
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 2em;
}

.form-group-login {
    margin-bottom: 20px;
    text-align: left;
}

.form-group-login label {
    display: block;
    margin-bottom: 5px;
    color: var(--foreground);
    font-weight: bold;
}

.form-group-login input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font-size: 16px;
    background: var(--card);
    color: var(--foreground);
    transition: border-color 0.3s ease;
}

.form-group-login input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 20%, transparent);
}

.login-btn {
    width: 100%;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 15px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background: var(--chart-2);
}

.login-btn:disabled {
    background: var(--muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
}

.error-message-login {
    font-size: 1em;
    display: none;
    background: color-mix(in srgb, var(--destructive) 15%, transparent);
    color: var(--destructive);
    padding: 25px 20px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--destructive) 30%, transparent);
    text-align: center;
    margin-top: 20px;
}

.loading-login {
    display: none;
    text-align: center;
    color: var(--muted-foreground);
    margin-top: 10px;
}

/* ============================================================
   PROTECTED CONTENT / HEADER BAR
   ============================================================ */

.protected-content {
    display: none;
}

.header-bar {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-bar a:hover {
    opacity: 0.8;
    transform: translateX(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: var(--destructive);
    color: var(--destructive-foreground);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: color-mix(in srgb, var(--destructive) 85%, black);
}

/* ============================================================
   LANGUAGE SELECTION SCREEN
   ============================================================ */

.language-selection-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    gap: 32px;
    background: var(--background);
    color: var(--foreground);
    text-align: center;
    padding: 40px 20px;
}

/* Header block */
.lang-screen-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.company-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--primary) 40%, transparent));
}

.language-selection-screen h1 {
    font-size: 2.6em;
    font-weight: bold;
    line-height: 1.2;
    color: var(--primary) !important;
    margin: 0;
}

.lang-subtitle {
    font-size: 1.1em;
    color: var(--foreground);
    font-weight: 500;
    margin: 0;
}

.lang-desc {
    font-size: 0.9em;
    color: var(--muted-foreground);
    margin: 0;
}

.language-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 400px;
    width: 100%;
}

.language-choice-btn {
    position: relative;
    height: 56px;
    width: 100%;
    cursor: pointer;
    border-radius: 9999px;
    border: 1px solid var(--border);
    padding: 4px;
    background: var(--card);
    outline: none;
    overflow: hidden;
}

.language-choice-btn:hover .motion-circle {
    width: calc(100% - 8px);
}

.language-choice-btn:hover .motion-text {
    color: var(--background);
}

.flag {
    width: 40px;
    height: auto;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

.current-flag {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    display: none;
}

.language-selector {
    background: var(--card);
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.change-language-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    width: fit-content;
    min-height: 44px;
}

.change-language-btn:hover,
.change-language-btn:active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.current-flag {
    font-size: 16px;
}

.header {
    border-bottom: 1px solid var(--border);
    background: var(--card);
    padding: 25px 15px;
    text-align: center;
    color: var(--card-foreground);
}

.header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--foreground);
    font-weight: bold;
    line-height: 1.2;
}

.header p {
    font-size: 0.95em;
    color: var(--foreground);
    opacity: 0.9;
    line-height: 1.4;
}

.header-lang-hint {
    font-size: 0.88em;
    color: var(--foreground);
    margin-bottom: 8px;
    opacity: 0.75;
    font-weight: 300;
    letter-spacing: 0.01em;
}

.content {
    padding: 30px 15px;
    background: var(--background);
    min-height: calc(100vh - 200px);
}

.header-bar {
    background: var(--card);
    color: var(--primary);
}

/* ============================================================
   SAFETY CARDS
   ============================================================ */

.safety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.safety-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 2);
    padding: 16px 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur) rgba(0,0,0,var(--shadow-opacity));
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.safety-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--chart-1), var(--chart-2), var(--chart-3));
}

.safety-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.safety-card h3 {
    color: var(--card-foreground);
    margin-bottom: 6px;
    font-size: 1.25em;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.safety-card p {
    color: var(--muted-foreground);
    font-size: 0.82em;
    line-height: 1.35;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ============================================================
   STAR BUTTON
   ============================================================ */

@keyframes star-btn-anim {
    0%   { offset-distance: 0%; }
    100% { offset-distance: 100%; }
}

.star-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    height: 32px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    margin-top: 12px;
    transition: border-color 0.3s, transform 0.2s;
    flex-shrink: 0;
}

.star-btn:hover {
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

.star-btn:active {
    transform: translateY(0);
}

.star-light {
    position: absolute;
    width: 160px;
    aspect-ratio: 1;
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--primary) 55%, transparent), transparent 65%);
    offset-path: var(--path);
    offset-distance: 0%;
    animation: star-btn-anim 4s linear infinite;
    pointer-events: none;
    translate: -50% -50%;
    z-index: 0;
}

.star-btn-text {
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, var(--card), var(--muted-foreground));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card);
    margin: 20px auto;
    padding: 0;
    border-radius: calc(var(--radius) * 2);
    width: 95%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-header {
    background: var(--muted);
    color: var(--card-foreground);
    padding: 20px 25px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: bold;
    color: var(--card-foreground);
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-btn {
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    padding: 0;
}

.share-btn:hover {
    background: var(--chart-2);
    transform: scale(1.1);
}

.close {
    position: relative;
    background: var(--destructive);
    color: var(--destructive-foreground);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    padding: 0;
}

.close:hover {
    background: color-mix(in srgb, var(--destructive) 85%, black);
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
    line-height: 1.6;
    color: var(--card-foreground);
}

.modal-body h3 {
    color: var(--card-foreground);
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
}

.modal-body h4 {
    color: var(--card-foreground);
    margin: 20px 0 10px 0;
    font-size: 1.1em;
    font-weight: bold;
}

.modal-body p {
    margin-bottom: 15px;
    color: var(--muted-foreground);
}

.modal-body ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
    color: var(--muted-foreground);
}

/* ============================================================
   INFO BOXES
   ============================================================ */

.highlight-box {
    background: rgba(52, 211, 153, 0.08);
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin: 15px 0;
    border-radius: var(--radius);
    color: var(--foreground);
}

.warning-box {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    border-left: 4px solid var(--warning);
    padding: 15px;
    margin: 15px 0;
    border-radius: var(--radius);
    color: var(--foreground);
}

.danger-box {
    background: color-mix(in srgb, var(--destructive) 12%, transparent);
    border-left: 4px solid var(--destructive);
    padding: 15px;
    margin: 15px 0;
    border-radius: var(--radius);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-card {
    background: var(--muted);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--foreground);
}

.info-card a,
.company-info a,
.modal-body a {
    color: var(--card-foreground) !important;
    text-decoration: none !important;
}

.company-info {
    background: var(--secondary);
    padding: 15px;
    border-radius: var(--radius);
    margin: 15px 0;
    border-left: 4px solid var(--chart-2);
    color: var(--secondary-foreground);
}

/* ============================================================
   RTL (Arabic)
   ============================================================ */

.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .language-selector {
    text-align: center;
}

.rtl .change-language-btn {
    margin: 0 auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 769px) {
    .language-selection-screen h1 {
        font-size: 3.5em;
    }

    .language-buttons {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        max-width: 1000px;
    }

    .content {
        padding: 40px 30px;
    }

    .safety-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .modal-content {
        width: 80%;
        margin: 5% auto;
    }

    .modal-body {
        padding: 30px;
    }
}

@media (min-width: 1024px) {
    .header {
        padding: 40px 30px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .content {
        padding: 50px 40px;
    }
}

@media (max-width: 600px) {
    /* Language screen compact on mobile */
    .language-selection-screen {
        gap: 16px;
        padding: 24px 16px;
        justify-content: flex-start;
        padding-top: 40px;
    }

    .lang-screen-header {
        gap: 6px;
    }

    .company-logo {
        width: 56px;
        height: 56px;
        margin-bottom: 4px;
    }

    .language-selection-screen h1 {
        font-size: 1.8em;
    }

    .lang-subtitle {
        font-size: 0.95em;
    }

    .lang-desc {
        font-size: 0.8em;
    }

    .language-buttons {
        gap: 8px;
        max-width: 100%;
    }

    .language-choice-btn {
        height: 48px;
        padding: 3px;
    }

    .motion-circle {
        height: 42px;
        width: 42px;
    }

    .motion-icon .flag {
        width: 26px;
    }

    .motion-text {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header p {
        font-size: 0.85em;
    }

    .content {
        padding: 20px 10px;
    }

    .safety-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .safety-card {
        padding: 14px 14px 12px;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }

    .modal-body {
        padding: 20px;
    }
}

/* ============================================================
   MOTION BUTTON (shared by language-choice-btn)
   ============================================================ */

.motion-circle {
    display: block;
    height: 48px;
    width: 48px;
    border-radius: 9999px;
    background: var(--primary);
    transition: width 0.5s ease;
    margin: 0;
    flex-shrink: 0;
}

.motion-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    transition: transform 0.5s ease;
    display: flex;
    align-items: center;
}

.motion-icon .flag {
    width: 32px;
    height: auto;
    border-radius: 3px;
}

.language-choice-btn:hover .motion-icon {
    transform: translateY(-50%) translateX(4px);
}

.motion-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-left: 16px;
    white-space: nowrap;
    font-size: 1em;
    font-weight: 500;
    color: var(--foreground);
    transition: color 0.5s ease;
    pointer-events: none;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ============================================================
   IMAGE LIGHTBOX
   ============================================================ */

.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.image-modal-content {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.image-modal-close:hover {
    color: var(--warning);
    transform: scale(1.2);
}

.clickable-image {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .image-modal {
        padding: 10px;
    }

    .image-modal-content {
        max-width: 95vw;
        max-height: 80vh;
    }

    .image-modal-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
}
