@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f5f5f5;
    direction: rtl;
    text-align: right;
}

.navbar {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    filter: brightness(0) invert(1);
}

.navbar-nav {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-nav a:hover {
    background-color: #34495e;
}

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

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.dashboard-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.dashboard-card .icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-draft {
    background-color: #ffc107;
    color: #856404;
}

.status-submitted {
    background-color: #17a2b8;
    color: white;
}

.status-approved {
    background-color: #28a745;
    color: white;
}

.status-violation {
    background-color: #dc3545;
    color: white;
}

.status-no-violation {
    background-color: #28a745;
    color: white;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.signature-pad {
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.well-item {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.well-item .remove-well {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #e74c3c;
    cursor: pointer;
}

/* Mobile First Responsive Design */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 10px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
        flex-direction: column;
        text-align: center;
    }
    
    .navbar-brand img {
        margin: 0 0 5px 0;
        height: 30px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .navbar-nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .container {
        margin: 1rem auto;
        padding: 0 10px;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-header {
        font-size: 1.2rem;
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .card-header img {
        margin-top: 10px;
        height: 35px !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .dashboard-card .icon {
        font-size: 2rem;
    }
    
    .form-control {
        padding: 0.6rem;
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        margin: 0.2rem;
        width: auto;
        min-width: 80px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.3rem;
    }
    
    /* Hide less important columns on mobile */
    .table .mobile-hide {
        display: none;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .wells-container .well-item {
        padding: 0.8rem;
    }
    
    #map {
        height: 250px;
    }
    
    .signature-pad {
        width: 100%;
        height: 150px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 15px;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .btn {
        margin: 0.2rem;
    }
    
    #map {
        height: 300px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navbar-brand img {
        height: 35px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .navbar-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dashboard-card {
        min-height: 120px;
    }
}