:root {
    --primary-color: #ff6600;
    --secondary-color: #ff9933;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --white: #ffffff;
    --red: #e74c3c;
    --green: #2ecc71;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

header {
    background: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid var(--secondary-color);
}

.header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.4;
    animation: zoomInOut 20s infinite alternate;
}

@keyframes zoomInOut {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.header-content {
    position: relative;
    z-index: 2;
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.wifi-badge {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: bold;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    overflow: hidden;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.login-card img {
    width: 120px;
    margin-bottom: 25px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.1));
}

.form-group {
    margin-bottom: 25px;
    text-align: right;
}

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

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.1);
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: 0.4s;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: #e65c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 92, 0, 0.4);
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 20px;
}

table th {
    background: transparent;
    color: var(--dark-color);
    padding: 15px;
    font-weight: bold;
}

table tr {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: 0.3s;
}

table tr:hover {
    transform: scale(1.01);
}

table td {
    padding: 20px;
    text-align: center;
}

table tr td:first-child { border-radius: 0 10px 10px 0; }
table tr td:last-child { border-radius: 10px 0 0 10px; }

.status-paid {
    background: rgba(46, 204, 113, 0.1);
    color: var(--green);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.status-unpaid {
    background: rgba(231, 76, 60, 0.1);
    color: var(--red);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.total-collected {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 800;
    text-align: center;
    margin: 40px 0;
    padding: 20px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(255, 102, 0, 0.1);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.archive-item {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    border-right: 6px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    transition: 0.3s;
}

.archive-item:hover {
    transform: translateY(-5px);
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--red);
    border: 1px solid var(--red);
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: var(--green);
    border: 1px solid var(--green);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
        padding: 0 15px;
    }
    
    .container {
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

    table th, table td {
        padding: 10px 5px;
        font-size: 0.9rem;
    }

    .total-collected {
        font-size: 1.4rem;
        padding: 15px;
    }

    .archive-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .admin-nav div {
        width: 100%;
    }

    .tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tab-btn {
        width: 100%;
        margin-bottom: 5px;
    }

    form {
        width: 100% !important;
        max-width: none !important;
    }

    .btn {
        padding: 12px 15px;
    }
    
    /* Responsive Table for mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 10px;
        padding: 10px;
    }
    
    td {
        border: none;
        position: relative;
        padding-right: 50% !important;
        text-align: left !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    td:before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary-color);
    }
}
