/* ڕێکخستنی گشتی (General Styles) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

:root {
    --primary-color: #0066cc;
    --primary-dark: #004a99;
    --secondary-color: #00ccff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f5f7fa;
    --dark-text: #1a1a1a;
    --gray-text: #666;
    --border-color: rgba(0,0,0,0.1);
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.12);
}

body {
    background: linear-gradient(135deg, var(--light-bg) 0%, #e4edf5 100%);
    min-height: 100vh;
    direction: rtl;
    color: var(--dark-text);
}

/* پەڕەی چوونەژوورەوە (Login Page) */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: white;
    border-radius: 15px;
    padding: 40px 35px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

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

.login-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: var(--gray-text);
    font-size: 0.95rem;
}

.login-form {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

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

.input-icon {
    position: relative;
}

.input-icon .icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--gray-text);
    pointer-events: none;
}

.input-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: var(--danger-color);
}

.alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: var(--success-color);
}

.alert-icon {
    font-size: 1.2rem;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: var(--gray-text);
    font-size: 0.85rem;
}

.login-footer p {
    margin: 4px 0;
}

/* سەردێڕ و مێنیو (Header & Menu) */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
}

.header-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: left;
}

.user-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
}

.user-role {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* کۆنتەینەر (Container) */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.page-header {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.page-header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* کارتی ئامار (Stats Cards) */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

.stat-icon {
    font-size: 2.2rem;
    margin-left: 15px;
    opacity: 0.9;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--gray-text);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-info p {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ماندوڵەکان (Modules Grid) */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.module-card {
    background: white;
    border-radius: 18px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.module-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.module-icon {
    font-size: 3.8rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.module-card:hover .module-icon {
    transform: scale(1.1);
}

.module-title {
    font-size: 1.2rem;
    color: var(--dark-text);
    margin-bottom: 20px;
    font-weight: 600;
}

.module-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,102,204,0.2);
}

.module-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 8px 25px rgba(0,102,204,0.3);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-card:nth-child(1) { animation-delay: 0.05s; }
.module-card:nth-child(2) { animation-delay: 0.1s; }
.module-card:nth-child(3) { animation-delay: 0.15s; }
.module-card:nth-child(4) { animation-delay: 0.2s; }
.module-card:nth-child(5) { animation-delay: 0.25s; }
.module-card:nth-child(6) { animation-delay: 0.3s; }
.module-card:nth-child(7) { animation-delay: 0.35s; }
.module-card:nth-child(8) { animation-delay: 0.4s; }

/* کارت (Cards) */
.card {
    background: white;
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

/* خشتە (Tables) */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.data-table th {
    padding: 18px 15px;
    text-align: right;
    font-weight: 600;
    font-size: 1rem;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--light-bg);
}

/* فۆرمەکان (Forms) */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0,102,204,0.1);
}

select.form-control {
    cursor: pointer;
}

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

/* دوگمەکانی کردار (Action Buttons) */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.btn-edit {
    background: var(--info-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-edit:hover, .btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* پێوەر (Footer) */
.footer {
    background: white;
    border-radius: 18px;
    padding: 25px;
    margin: 20px;
    color: var(--gray-text);
    font-size: 0.95rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* مۆداڵ/پۆپەپ (Modal/Popup) */
.modal {
    display: none !important;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* دوگمەی کراوەکردنەوەی مۆداڵ */
.btn-add-modal {
    position: relative;
    overflow: hidden;
}

.btn-add-modal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-add-modal:active::before {
    width: 300px;
    height: 300px;
}

/* ڕێسپۆنسیڤ (Responsive) */
/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - دیزاینی گونجاو بۆ مۆبایل و تابلێت
   ═══════════════════════════════════════════════════════════ */

/* Large Tablets and Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .navbar ul {
        flex-direction: column;
        gap: 5px;
    }
    
    .navbar li {
        width: 100%;
    }
    
    .navbar a {
        padding: 12px 15px;
        justify-content: center;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .module-card {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    /* Tables - Responsive */
    .data-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-edit, .btn-delete {
        width: 100%;
        font-size: 0.85rem;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
    
    /* Search Forms */
    .page-header > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    
    .page-header form {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .page-header form > div {
        flex-wrap: wrap;
    }
    
    .page-header .btn {
        width: 100%;
    }
}

/* Mobile Phones (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 10px;
    }
    
    .header-title h1 {
        font-size: 1.3rem;
    }
    
    .navbar {
        padding: 5px;
    }
    
    .navbar a {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .navbar a span {
        display: none; /* Hide text, keep icons only */
    }
    
    .stats-container {
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-info h3 {
        font-size: 0.9rem;
    }
    
    .stat-info p {
        font-size: 1.3rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .module-card {
        padding: 15px;
    }
    
    .module-icon {
        font-size: 2.5rem;
    }
    
    .module-title {
        font-size: 1rem;
    }
    
    .page-header {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 1.3rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .card {
        padding: 10px;
        border-radius: 10px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-control,
    .form-select {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 5px;
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Tables - Stack on Mobile */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
        min-width: 80px;
    }
    
    .data-table th:first-child,
    .data-table td:first-child {
        position: sticky;
        right: 0;
        background: white;
        z-index: 1;
    }
    
    /* Search and Filter Forms */
    .page-header form input,
    .page-header form select,
    .page-header form button {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
    }
    
    .page-header form > div {
        flex-direction: column !important;
    }
    
    /* Alert Messages */
    .alert {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    /* Login Page */
    .login-box {
        padding: 25px 20px;
    }
    
    .login-logo {
        font-size: 2rem;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
}

/* Extra Small Devices (max-width: 360px) */
@media (max-width: 360px) {
    .header-title h1 {
        font-size: 1.1rem;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .module-card {
        padding: 12px;
    }
    
    .module-icon {
        font-size: 2rem;
    }
    
    .page-header h1 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .page-header {
        padding: 10px 15px;
    }
    
    .navbar ul {
        flex-direction: row;
        flex-wrap: wrap;
    }
}
