/* Plaza Management System - Modern Responsive Theme */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --text-light: #6b7280;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}


.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    margin-top: 0.5rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: white;
    color: white;
}

.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: white;
    color: white;
    font-weight: 500;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Sidebar Scrollbar Styling */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    margin-top: auto;
    flex-shrink: 0;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
    width: 100%;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Top Header */
.top-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

/* Header User Info */
.header-user {
    display: flex;
    align-items: center;
    position: relative;
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.user-info-header:hover {
    background-color: var(--light-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-info-header.active {
    background-color: var(--light-color);
}

.user-info-text {
    text-align: right;
}

.user-name-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
    line-height: 1.2;
}

.user-role-header {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: capitalize;
    line-height: 1.2;
}

.user-info-header i.fa-user-circle {
    font-size: 2rem;
    color: var(--primary-color);
}

.user-dropdown-icon {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.3s ease;
    margin-left: 0.25rem;
}

.user-info-header.active .user-dropdown-icon {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--primary-color);
}

.dropdown-item:last-child {
    color: var(--danger-color);
}

.dropdown-item:last-child:hover {
    background-color: #fef2f2;
    color: var(--danger-color);
}

.dropdown-item:last-child i {
    color: var(--danger-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Navigation (for public pages) */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1rem;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-user {
    position: relative;
}

.nav-user .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    color: var(--text-color);
    box-shadow: var(--shadow-lg);
    border-radius: 0.375rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 150px;
    list-style: none;
}

.nav-user:hover .dropdown {
    display: block;
}

.nav-user .dropdown li a {
    color: var(--text-color);
    padding: 0.75rem 1rem;
    display: block;
}

.nav-user .dropdown li a:hover {
    background-color: var(--light-color);
}

/* Main Content (for public pages without sidebar) */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.card > .table-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    position: relative;
    max-height: calc(100vh - 300px);
    width: 100%;
    max-width: 100%;
    display: block;
    flex: 1;
    min-height: 0;
}

.table-container::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.table {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    margin: 0;
    table-layout: auto;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.table thead th {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    background: white;
}

.table tbody tr:hover td {
    background-color: var(--light-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card-link:hover .stat-card {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: white;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-left-color: #047857;
}

.stat-card.success::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-left-color: #b45309;
}

.stat-card.warning::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-left-color: #b91c1c;
}

.stat-card.danger::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0.3rem 0;
    position: relative;
    z-index: 1;
}

.stat-card.success .stat-value,
.stat-card.warning .stat-value,
.stat-card.danger .stat-value {
    color: white;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.stat-card.success .stat-label,
.stat-card.warning .stat-label,
.stat-card.danger .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.stat-card.success .stat-icon,
.stat-card.warning .stat-icon,
.stat-card.danger .stat-icon {
    color: white;
    opacity: 1;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Login Page Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }

    .login-header i {
        font-size: 2.5rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-header {
        padding: 1rem 1.5rem;
    }

    .sidebar-user {
        padding: 1rem 1.5rem;
    }

    .sidebar-nav {
        padding: 0.5rem 0;
    }

    .sidebar-menu a {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .sidebar-toggle {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .top-header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .header-title {
        flex: 1;
        min-width: 0;
    }

    .header-title h1 {
        font-size: 1.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-user {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

    .user-info-header {
        width: 100%;
        justify-content: space-between;
    }

    .user-info-text {
        text-align: left;
    }

    .user-name-header {
        font-size: 0.9rem;
    }

    .user-role-header {
        font-size: 0.75rem;
    }

    .user-info-header i.fa-user-circle {
        font-size: 1.75rem;
    }
    
    .user-dropdown-menu {
        right: 0;
        left: 0;
        min-width: auto;
        width: 100%;
    }

    .main-content {
        padding: 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-dark);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: scroll;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .card {
        padding: 1rem;
    }
}

/* Login Page */
.login-container {
    max-width: 420px;
    width: 100%;
    padding: 3rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.login-header h1 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 600;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 36px;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn i {
    margin: 0;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background-color: var(--light-color);
}

.file-upload input[type="file"] {
    display: none;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

