:root {
    --primary-color: #4a90e2;
    /* Vibrant Blue */
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --light-bg: #f5f7fa;
    --text-color: #333;
    --white: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header & Nav */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.5rem;
}

nav a {
    color: var(--white);
    text-decoration: none;
    margin-left: 15px;
}

/* Forms */
.auth-form,
.entry-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

button:hover {
    background-color: #2980b9;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-error {
    background-color: #fadbd8;
    color: var(--danger-color);
}

.alert-success {
    background-color: #d4efdf;
    color: var(--success-color);
}

/* Search */
.search-box {
    text-align: center;
    margin: 2rem 0;
}

.search-box input {
    width: 70%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid var(--primary-color);
    border-radius: 30px;
}

.search-box button {
    width: auto;
    margin-top: 1rem;
    border-radius: 30px;
}

/* Results */
.result-card {
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rating-stars {
    font-size: 1.5rem;
}

.star-red {
    color: var(--danger-color);
}

.star-yellow {
    color: var(--warning-color);
}

.star-green {
    color: var(--success-color);
}

.star-grey {
    color: #ccc;
}

.reliability-high {
    color: var(--success-color);
    font-weight: bold;
}

.reliability-medium {
    color: var(--warning-color);
    font-weight: bold;
}

.reliability-low {
    color: var(--danger-color);
    font-weight: bold;
}

/* Star Input */
.star-rating {
    direction: rtl;
    display: inline-block;
}

.star-rating input {
    display: none;
}

.star-rating label {
    color: #ccc;
    font-size: 2rem;
    padding: 0;
    cursor: pointer;
    float: right;
}

.star-rating input:checked~label {
    color: var(--warning-color);
    /* Default to yellow, JS can change based on value */
}

.star-rating input:checked~label:hover,
.star-rating label:hover~input:checked~label,
.star-rating label:hover {
    color: var(--warning-color);
}

.entry-image {
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 600px) {
    .search-box input {
        width: 100%;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    /* High z-index to overlay everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    /* Nice effect */
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    /* Less top margin */
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-body p {
    margin-bottom: 10px;
}

/* Compact Table & Actions */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: auto;
    /* Allow auto sizing */
}

.compact-table th,
.compact-table td {
    padding: 6px 4px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.compact-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

/* Column specific tweaks */
.col-date {
    width: 70px;
}

.col-phone {
    width: 110px;
    font-weight: bold;
}

.col-rating {
    width: 40px;
    text-align: center;
}

.col-actions {
    width: 120px;
    white-space: nowrap;
    text-align: center;
}

/* Truncate text cells */
.col-text {
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 14px;
    margin: 0 2px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.8;
}

.btn-view {
    background-color: var(--success-color);
}

.btn-edit {
    background-color: var(--accent-color);
}

.btn-hide {
    background-color: var(--warning-color);
    color: #333;
}

.btn-delete {
    background-color: var(--danger-color);
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 3px;
    border: none;
    color: white;
    cursor: pointer;
    width: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .col-reporter {
        display: none;
    }

    /* Hide reporter on mobile */
    .col-date {
        display: none;
    }

    /* Hide date on mobile */
    .col-text {
        max-width: 80px;
    }

    /* Smaller text truncation */

    .compact-table th,
    .compact-table td {
        padding: 4px 2px;
        font-size: 0.75rem;
    }

    .action-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}