/* Agriculture Q&A Website - Modern Styling */

/* CSS Variables for consistent theming */
:root {
    --primary-green: #2d7a3e;
    --secondary-green: #4caf50;
    --light-green: #81c784;
    --dark-green: #1b5e20;
    --earth-brown: #795548;
    --light-bg: #f1f8f4;
    --white: #ffffff;
    --text-dark: #212121;
    --text-light: #757575;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f1f8f4 0%, #e8f5e9 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: var(--white);
    padding: 2.5rem 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
    pointer-events: none;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

[dir="rtl"] .header-title-section {
    justify-content: flex-end;
}

.main-logo {
    height: 120px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3)) brightness(0) invert(1);
    transition: all 0.3s ease;
    background: transparent;
    padding: 1rem;
    border-radius: 12px;
}

.main-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.5)) brightness(0) invert(1);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    flex: 1;
    min-width: 200px;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
    margin-top: 0.5rem;
    padding-left: 0;
}

/* RTL adjustments for logo */
[dir="rtl"] .header-title-section {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

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

[dir="rtl"] .tagline {
    text-align: right;
    padding-right: 0;
}

[dir="rtl"] .main-logo {
    order: 2;
}

/* Navigation */
nav {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style: none;
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--primary-green);
    background: var(--light-bg);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--secondary-green);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 80%;
}

/* Main Content Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card h2 {
    color: var(--primary-green);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--light-green);
    padding-bottom: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

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

select.form-control {
    cursor: pointer;
    background: var(--white);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-green) 0%, var(--primary-green) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

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

/* Question Display Styles */
.question-item {
    background: var(--white);
    border-left: 4px solid var(--secondary-green);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.question-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
    min-width: 200px;
}

.category-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--light-green);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.question-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.answer-section {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.answer-label {
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.answer-text {
    color: var(--text-dark);
    line-height: 1.7;
}

.no-answer {
    color: var(--text-light);
    font-style: italic;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-answered {
    background: #c8e6c9;
    color: var(--dark-green);
}

.status-pending {
    background: #fff9c4;
    color: #f57f17;
}

/* AI Badge */
.ai-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #c8e6c9;
    color: var(--dark-green);
    border-left: 4px solid var(--secondary-green);
}

.alert-error {
    background: #ffcdd2;
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* GridView Styling */
.gridview {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.gridview th {
    background: var(--primary-green);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.gridview td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.gridview tr:hover {
    background: var(--light-bg);
}

/* Language Switcher */
.lang-switcher {
    margin-left: auto;
}

.lang-link {
    color: var(--primary-green) !important;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: var(--light-bg);
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.lang-link:hover {
    background: var(--secondary-green);
    color: var(--white) !important;
}

/* RTL Support for Arabic */
[dir="rtl"] nav ul {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-switcher {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .question-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .question-meta {
    flex-direction: row-reverse;
}

[dir="rtl"] .category-badge {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .ai-badge {
    margin-left: 0;
    margin-right: 0.5rem;
}

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

[dir="rtl"] .btn {
    direction: rtl;
}

[dir="rtl"] .question-item:hover {
    transform: translateX(-4px);
}

/* Arabic Font Support */
[dir="rtl"] body {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .header-title-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .main-logo {
        height: 90px;
        max-width: 140px;
    }

    .tagline {
        text-align: center;
    }

    .container {
        padding: 0 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    nav ul {
        flex-direction: column;
        padding: 0;
    }

    nav a {
        border-bottom: 1px solid var(--border-color);
    }

    .question-header {
        flex-direction: column;
    }

    .question-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .lang-switcher {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .main-logo {
        height: 70px;
        max-width: 110px;
    }

    .tagline {
        font-size: 0.95rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.question-item {
    animation: fadeIn 0.5s ease-out;
}
/* Enhanced Arabic Typography */
[dir="rtl"] h1 {
    font-weight: 700;
    letter-spacing: 0.5px;
}

[dir="rtl"] h2 {
    font-weight: 600;
    letter-spacing: 0.4px;
}

[dir="rtl"] h3 {
    font-weight: 600;
}

[dir="rtl"] .form-control {
    font-size: 15px;
}

[dir="rtl"] label {
    font-size: 15px;
    font-weight: 600;
}

[dir="rtl"] nav a {
    font-size: 15px;
}

[dir="rtl"] .tagline {
    font-size: 1.15rem;
    letter-spacing: 0.3px;
}

[dir="rtl"] .question-text {
    font-size: 1.15rem;
}

[dir="rtl"] .category-badge {
    font-size: 0.9rem;
}
