/**
 * NSRP Modules CSS - Stilet për komponentët modularë
 * National Security Response Platform - Kosovo
 */

/* ========================================
   Toast/Notification Styles
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 12px;
    border-left: 4px solid var(--neon-blue, #00d4ff);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.3rem;
}

.toast-message {
    flex: 1;
    color: #fff;
    font-size: 0.95rem;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #fff;
}

/* Toast Types */
.toast-info {
    border-left-color: #00d4ff;
}
.toast-info .toast-icon {
    color: #00d4ff;
}

.toast-success {
    border-left-color: #4CAF50;
}
.toast-success .toast-icon {
    color: #4CAF50;
}

.toast-warning {
    border-left-color: #FF9800;
}
.toast-warning .toast-icon {
    color: #FF9800;
}

.toast-error {
    border-left-color: #f44336;
}
.toast-error .toast-icon {
    color: #f44336;
}

/* ========================================
   Modal Styles
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-visible {
    opacity: 1;
}

.modal-visible .modal-container {
    transform: scale(1) translateY(0);
}

.modal-container {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.max-w-md { max-width: 400px; }
.max-w-2xl { max-width: 600px; }
.max-w-4xl { max-width: 900px; }
.max-w-full { max-width: calc(100% - 32px); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   Loader Styles
   ======================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader-visible {
    opacity: 1;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--neon-blue, #00d4ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   Dropdown Styles
   ======================================== */
.dropdown-menu {
    position: fixed;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 8px 0;
    z-index: 9000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-visible {
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dropdown-item.active {
    background: rgba(0, 212, 255, 0.2);
    color: var(--neon-blue, #00d4ff);
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Tab Styles
   ======================================== */
.tab-list {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ========================================
   Progress Bar Styles
   ======================================== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-animated {
    position: relative;
    overflow: hidden;
}

.progress-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to { left: 100%; }
}

.progress-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

/* ========================================
   Data Table Styles
   ======================================== */
.table-search {
    margin-bottom: 16px;
}

.table-search-input {
    width: 100%;
    max-width: 300px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.table-search-input:focus {
    outline: none;
    border-color: var(--neon-blue, #00d4ff);
    background: rgba(255, 255, 255, 0.08);
}

.table-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.data-table th.sortable:hover {
    color: var(--neon-blue, #00d4ff);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
}

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

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-table tbody tr.clickable {
    cursor: pointer;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
}

.pagination-btn {
    padding: 8px 12px;
    min-width: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pagination-btn.active {
    background: var(--neon-blue, #00d4ff);
    border-color: var(--neon-blue, #00d4ff);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-dots {
    color: rgba(255, 255, 255, 0.5);
    padding: 0 8px;
}

/* ========================================
   Card Styles
   ======================================== */
.card {
    border-radius: 16px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.card-icon {
    font-size: 1.5rem;
    color: var(--neon-blue, #00d4ff);
}

.card-header-text {
    flex: 1;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.card-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

/* ========================================
   Stat Card Styles
   ======================================== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
}

.stat-primary .stat-icon {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.stat-success .stat-icon {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.stat-warning .stat-icon {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.stat-danger .stat-icon {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.stat-info .stat-icon {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.trend-up {
    color: #4CAF50;
}

.trend-down {
    color: #f44336;
}

/* ========================================
   Form Styles
   ======================================== */
.input-error {
    border-color: #f44336 !important;
}

.error-message {
    display: block;
    color: #f44336;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: #fff;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.p-4 { padding: 1rem; }

.mr-2 { margin-right: 0.5rem; }
.ml-1 { margin-left: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }

.hidden { display: none !important; }

/* ========================================
   Responsive - Enhanced
   ======================================== */

/* Large screens */
@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium screens */
@media (max-width: 1199px) and (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }
}

/* Tablets and smaller */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .modal-container {
        width: 95%;
        max-height: 90vh;
        margin: 20px auto;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
    }

    .stat-card {
        flex-direction: row;
        text-align: left;
        padding: 15px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-header {
        padding: 12px 15px;
    }

    .card-body {
        padding: 15px;
    }

    .card-title {
        font-size: 1rem;
    }

    .table-wrapper {
        font-size: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 12px;
        gap: 8px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .card-header {
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .card-body {
        padding: 12px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .toast {
        padding: 12px 15px;
        font-size: 0.85rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        text-align: left;
    }
}
