/* ============================================================
   Trustpilot-Inspired Review System Styles
   ============================================================ */

:root {
    --green-primary: #00b67a;
    --green-dark: #008f5a;
    --green-light: #e6f9f1;
    --gold: #ffb400;
    --gold-dark: #e09e00;
    --gray-100: #f7f8fa;
    --gray-200: #ededed;
    --gray-300: #dct;
    --gray-400: #a9a9a9;
    --gray-500: #767676;
    --gray-700: #333333;
    --gray-900: #1a1a1a;
    --danger: #e3424a;
    --danger-dark: #c92b33;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-900);
    background: var(--gray-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
}
.logo-star {
    color: var(--green-primary);
    font-size: 1.6rem;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover { color: var(--green-primary); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    line-height: 1.4;
}
.btn-primary {
    background: var(--green-primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-ghost {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: var(--danger-dark); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-xs { padding: 4px 10px; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Hero / Rating Summary ---------- */
.hero {
    background: linear-gradient(135deg, var(--white) 0%, var(--green-light) 100%);
    padding: 50px 0;
    border-radius: var(--radius-lg);
    margin: 30px auto;
    box-shadow: var(--shadow-md);
}
.hero-content {
    text-align: center;
    padding: 0 20px;
}
.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--gray-900);
}
.hero-tagline {
    color: var(--gray-500);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.rating-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: center;
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: left;
}
.rating-big { text-align: center; }
.rating-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 8px;
}
.rating-count {
    color: var(--gray-500);
    margin-top: 8px;
    font-size: 0.95rem;
}

.rating-bars { width: 100%; }
.bar-row {
    display: grid;
    grid-template-columns: 50px 1fr 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}
.bar-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}
.bar-track {
    background: var(--gray-200);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}
.bar-fill {
    background: var(--green-primary);
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.bar-count {
    text-align: right;
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---------- Stars ---------- */
.stars { display: inline-flex; gap: 2px; }
.star {
    color: #dcdce6;
    font-size: 1.3rem;
    line-height: 1;
}
.star.filled { 
    color: #00b67a;
}
.stars-lg .star { font-size: 2rem; }
.stars-sm .star { font-size: 1rem; }
.stars-md .star { font-size: 1.3rem; }

/* ---------- Reviews Section ---------- */
.reviews-section {
    margin: 40px auto;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gray-900);
}
.form-subtitle {
    color: var(--gray-500);
    margin-bottom: 25px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}
.review-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 15px;
}
.reviewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.reviewer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--green-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.reviewer-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 1rem;
}
.reviewer-country {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 2px;
}
.review-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}
.review-body {
    color: var(--gray-700);
    margin-bottom: 14px;
    line-height: 1.7;
    word-wrap: break-word;
}
.review-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
    font-size: 0.88rem;
    color: var(--gray-500);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.empty-icon { font-size: 3rem; margin-bottom: 15px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--gray-500); margin-bottom: 20px; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    min-width: 40px;
    text-align: center;
}
.page-link:hover:not(.disabled):not(.active) {
    background: var(--green-light);
    border-color: var(--green-primary);
    color: var(--green-dark);
}
.page-link.active {
    background: var(--green-primary);
    color: var(--white);
    border-color: var(--green-primary);
}
.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- Write Review Form ---------- */
.write-review-section {
    margin: 50px auto;
}
.form-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}
.required { color: var(--danger); }
.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}
.form-input:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(0,182,122,0.15);
}
textarea.form-input {
    resize: vertical;
    min-height: 100px;
}
.form-hint {
    display: block;
    margin-top: 5px;
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Star rating input */
.star-rating-input {
    display: inline-flex;
    gap: 4px;
}
.star-pick {
    font-size: 2.2rem;
    color: #dcdce6;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    user-select: none;
}
.star-pick.active {
    color: #00b67a;
}
.star-pick.hover-active {
    color: #00b67a;
    transform: scale(1.1);
}
.rating-label {
    margin-top: 8px;
    color: var(--gray-500);
    font-size: 0.9rem;
    font-style: italic;
}

/* Checkbox */
.form-check { margin-top: 10px; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--gray-700);
}
.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--green-primary);
    cursor: pointer;
}

/* Honeypot */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success {
    background: var(--green-light);
    color: var(--green-dark);
    border: 1px solid var(--green-primary);
}
.alert-error {
    background: #fde7e9;
    color: var(--danger-dark);
    border: 1px solid var(--danger);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 30px 0;
    text-align: center;
    color: var(--gray-500);
    margin-top: 60px;
}
.footer-admin { margin-top: 8px; font-size: 0.85rem; }
.footer-admin a { color: var(--gray-500); text-decoration: none; }
.footer-admin a:hover { color: var(--green-primary); }

/* ============================================================
   ADMIN STYLES
   ============================================================ */
.admin-body {
    background: #f4f6f9;
    min-height: 100vh;
}

.admin-header {
    background: var(--gray-900);
    color: var(--white);
    padding: 14px 0;
}
.admin-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
}
.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--gray-300);
}
.admin-user .btn-ghost {
    color: var(--white);
    border-color: rgba(255,255,255,0.2);
}
.admin-user .btn-ghost:hover {
    background: rgba(255,255,255,0.1);
}

.admin-main { padding: 30px 20px; max-width: 1300px; margin: 0 auto; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.stat-label {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
}

.admin-toolbar {
    background: var(--white);
    padding: 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-input { flex: 1; }

.table-wrapper {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.admin-table th {
    background: var(--gray-100);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}
.admin-table tr:hover { background: var(--gray-100); }
.cell-title { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cell-email { color: var(--gray-500); font-size: 0.85rem; }
.cell-ip { font-family: monospace; font-size: 0.8rem; color: var(--gray-500); }
.empty-cell { text-align: center; padding: 40px !important; color: var(--gray-500); }
.inline-form { display: inline; }

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--green-light) 0%, #f4f6f9 100%);
}
.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
}
.login-card h1 {
    text-align: center;
    margin-bottom: 6px;
}
.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 25px;
}
.login-footer {
    text-align: center;
    margin-top: 20px;
}
.login-footer a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.9rem;
}
.login-footer a:hover { color: var(--green-primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .rating-summary {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .admin-stats { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .hero-title { font-size: 1.8rem; }
    .hero { padding: 30px 0; }
    .rating-number { font-size: 2.5rem; }
    .form-card { padding: 25px; }
    .review-card { padding: 18px; }
    .review-header { flex-direction: column; }
    .header-inner { height: 60px; }
    .logo { font-size: 1.2rem; }
    .btn-write-review { padding: 8px 16px; font-size: 0.85rem; }
    .admin-header-inner { flex-direction: column; gap: 10px; }
    .admin-user { flex-wrap: wrap; justify-content: center; }
    .search-form { flex-direction: column; }
    .search-form .btn { width: 100%; }
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 8px; }
}