/* Global Styles for Driving Test Legal Documents */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.8;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

[dir="rtl"] {
    text-align: right;
}

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

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    margin-bottom: 30px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 3em;
    margin-bottom: 20px;
}

h1 {
    color: #764ba2;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-align: center;
}

h2 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5em;
}

h3 {
    color: #764ba2;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

p {
    margin-bottom: 15px;
}

ul, ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

[dir="rtl"] ul, [dir="rtl"] ol {
    margin-left: 0;
    margin-right: 20px;
}

li {
    margin-bottom: 8px;
}

.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

[dir="rtl"] .language-selector {
    right: auto;
    left: 20px;
}

.language-selector select {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 120px;
}

.region-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.region-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    min-width: 250px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.region-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.region-card h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.region-card .flag {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
}

.links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    font-size: 14px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.button.secondary {
    background: #6c757d;
}

.document-list {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.document-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

[dir="rtl"] .document-item {
    border-left: none;
    border-right: 4px solid #667eea;
}

.document-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.document-item p {
    color: #666;
    margin-bottom: 15px;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    padding: 20px;
}

.footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

.last-updated {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.breadcrumb {
    margin-bottom: 20px;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    display: none;
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 20px;
}

.back-to-top:hover {
    transform: translateY(-2px);
}

.back-to-top.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .card {
        padding: 25px;
    }

    h1 {
        font-size: 2em;
    }

    .language-selector {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        text-align: center;
    }

    .region-selector {
        flex-direction: column;
        align-items: center;
    }

    .region-card {
        min-width: 200px;
    }

    .links {
        flex-direction: column;
        align-items: center;
    }

    .button {
        min-width: 200px;
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background: #2d3748;
        color: #e2e8f0;
    }

    .region-card, .document-item {
        background: #4a5568;
        color: #e2e8f0;
    }

    .language-selector {
        background: #2d3748;
    }

    .language-selector select {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
}