/*
 * Global styling for the dating site.
 * Defines a modern palette, typography and layout for admin, visitor and login pages.
 */

@charset "UTF-8";

/* Define colour variables for easy adjustments */
:root {
    --primary: #6366f1; /* Indigo */
    --primary-dark: #4f46e5;
    --danger: #e03131; /* red tone */
    --danger-dark: #c53030;
    --success: #2f9e44; /* green tone */
    --background: #f3f4f6;
    --text: #374151;
    --muted: #6b7280;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Reset some default margins */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.4;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 380px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 26px;
    font-weight: 600;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.login-box input[type="password"]:focus {
    border-color: var(--primary);
    outline: none;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: var(--primary-dark);
}

.login-box .error {
    color: var(--danger);
    margin-bottom: 15px;
}

/* Admin page */
.admin-page {
    padding: 20px 20px 40px;
}

.admin-page h1, .admin-page h2, .admin-page h3 {
    margin-bottom: 20px;
    color: var(--text);
    font-weight: 600;
}

.section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.section th {
    background: #f9fafb;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.section td {
    background: var(--card-bg);
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
}

.form-group {
    margin-bottom: 12px;
}

input[type="text"], input[type="number"], input[type="date"], textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
    background: #fafafa;
    color: var(--text);
}

input[type="file"] {
    width: 100%;
    margin-top: 4px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    margin-right: 6px;
}

button.primary {
    background: var(--primary);
    color: #fff;
}

button.primary:hover {
    background: var(--primary-dark);
}

button.danger {
    background: var(--danger);
    color: #fff;
}

button.danger:hover {
    background: var(--danger-dark);
}

button.success {
    background: var(--success);
    color: #fff;
}

button.success:hover {
    background: #22863a;
}

/* Visitor page */
.visitor-page header {
    background: var(--card-bg);
    padding: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.visitor-page header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
}

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

.next-dates {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 25px;
}

.next-dates h2 {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: var(--text);
    font-weight: 600;
}

.next-dates ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.next-dates li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
    color: var(--text);
}

.next-dates li:last-child {
    border-bottom: none;
}

.profile-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 25px;
}

.profile-top {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/*
 * Photo placeholder for visitor cards.
 * Maintain a perfect circle on all screen sizes by fixing the aspect ratio and
 * preventing flex items from shrinking. Without explicit width/height and
 * aspect-ratio, some browsers compressed the element causing an ellipse.
 */
.photo {
    width: 70px;
    height: 70px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e0e7ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    overflow: hidden;
    margin-right: 20px;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/*
 * Ensure photos and placeholders in the admin pages remain circular.
 * Admin lists and edit forms output images directly without special
 * wrappers, so we enforce consistent dimensions and border-radius here.
 */
.admin-page img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex-grow: 1;
}

.profile-info .name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.profile-info .comment {
    color: var(--muted);
    font-style: italic;
    margin-top: 4px;
    white-space: pre-wrap;
}

.profile-score {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.vote-btn {
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.vote-btn:hover:not(:disabled) {
    background: var(--danger-dark);
}

.vote-btn:disabled {
    background: #cbd5e1;
    color: #6b7280;
    cursor: not-allowed;
}

.charts {
    margin-top: 20px;
}