:root {
    --primary-gradient: linear-gradient(135deg, #6A0DAD, #9932CC);
    --secondary-gradient: linear-gradient(135deg, #00CED1, #20B2AA);
    --accent-gradient: linear-gradient(135deg, #FFD700, #FFA500);
    --background-gradient: linear-gradient(135deg, #E6E6FA, #F0F8FF);
    --text-color: #333;
    --light-text: #FFF;
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0.5rem auto 0;
    padding: 0.5rem;
    text-align: center;
    flex: 1;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 0.25rem;
    object-fit: contain;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: #6A0DAD;
}

.brand-tagline {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 0.25rem;
    font-weight: normal;
    letter-spacing: 0.02em;
}

.page-heading {
    font-size: 1.1rem;
    color: #6A0DAD;
    margin: 0.25rem 0 0;
    font-weight: 600;
}

.page-heading:empty {
    display: none;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 100%;
}

input[type="url"], input[type="text"], textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #6A0DAD;
    border-radius: 12px;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

input[type="url"]:focus, input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #9932CC;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button {
    background: var(--accent-gradient);
    color: #333;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
}

button:hover, button:focus {
    background: var(--primary-gradient);
    color: var(--light-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.result {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
}

.result a {
    color: #00CED1;
    font-weight: bold;
    text-decoration: underline;
}

.flash-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flash-message.error {
    background-color: #FFD2D2;
    color: #D8000C;
}

.flash-message.success {
    background-color: #DFF2BF;
    color: #4F8A10;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
}

th {
    background: #6A0DAD;
    color: var(--light-text);
    border-radius: 8px 8px 0 0;
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.6);
}

tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.8);
}

td {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

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

tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

a {
    color: #00CED1;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

a:hover, a:focus {
    color: #20B2AA;
    text-decoration: underline;
}

footer {
    background: #6A0DAD;
    color: var(--light-text);
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

footer nav {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--light-text);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: opacity 0.3s ease;
}

footer a:hover, footer a:focus {
    opacity: 0.8;
    text-decoration: underline;
}

.candidate-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.candidate-card h2 {
    color: #00CED1;
    margin-top: 0;
}

.ko-fi-button {
    margin-top: 1rem;
}

.ko-fi-button iframe {
    border: none;
    background: transparent !important;
}

.terms-content {
    text-align: left;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
}

.terms-content h2 {
    color: #6A0DAD;
    margin-top: 1.5rem;
}

.terms-content p {
    margin-bottom: 1rem;
}

.shortener-section {
    margin-bottom: 1rem;
}

.hero {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #6A0DAD;
}

.how-it-works {
    padding: 2rem 1rem;
    text-align: center;
}

.how-it-works .steps {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.step {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 auto 0.5rem;
}

.stats {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem 1rem;
    background: #6A0DAD;
    color: white;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.9;
}

.stats-caption {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    margin: -0.75rem 0 1.5rem;
    font-style: italic;
}

.featured-women {
    padding: 2rem 1rem;
}

.women-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.woman-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.woman-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}

.woman-card h4 {
    margin: 0 0 0.5rem 0;
    color: #6A0DAD;
}

.click-count {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.view-link {
    display: inline-block;
    color: #00CED1;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.woman-card-portrait {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 0 0.75rem 0;
    border: 2px solid #6A0DAD;
}

.woman-card .card-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.discover-women {
    padding: 2rem 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.discover-women h3 {
    text-align: center;
    color: #6A0DAD;
    margin-bottom: 1.25rem;
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.discover-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 3px solid #6A0DAD;
}

.discover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.discover-card strong {
    color: #6A0DAD;
    font-size: 0.95rem;
    line-height: 1.3;
}

.discover-meta {
    font-size: 0.78rem;
    color: #666;
}

.discover-more-note {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.mission {
    padding: 2rem 1rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: left;
}

.mission h3 {
    text-align: center;
    color: #6A0DAD;
}

.cta-container {
    text-align: center;
    margin-top: 1.5rem;
}

.btn-primary {
    display: inline-block;
    background: var(--accent-gradient);
    color: #333;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

.table {
    table-layout: fixed;
    width: 100%;
    word-break: break-word;
}

.table th:nth-child(1) { width: 18%; }
.table th:nth-child(2) { width: 52%; }
.table th:nth-child(3) { width: 12%; }
.table th:nth-child(4) { width: 18%; }

.btn-secondary {
    background: var(--secondary-gradient, linear-gradient(135deg, #00CED1, #20B2AA));
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 8px;
    width: auto;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.url-tooltip {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    vertical-align: bottom;
    cursor: pointer;
}

.url-tooltip:hover::after {
    content: attr(data-full-url);
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 10;
    background-color: rgba(40, 40, 40, 0.95);
    color: #fff;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    white-space: normal;
    word-break: break-all;
    max-width: 500px;
    min-width: 300px;
    font-size: 0.9rem;
}

.container-analytics {
    max-width: 95%;
    margin: 1rem auto;
}

/* ── Profile page ── */
.profile-page {
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
    padding: 0.5rem 0 2rem;
}

.profile-portrait-wrapper {
    float: right;
    margin: 0 0 1rem 1.5rem;
    text-align: center;
    max-width: 300px;
}

.profile-portrait {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    display: block;
}

.portrait-credit {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.4rem;
    line-height: 1.4;
}

.portrait-credit a {
    color: #888;
    font-weight: normal;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}

.profile-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.tag-discipline {
    background: rgba(106, 13, 173, 0.12);
    color: #6A0DAD;
}

.tag-region {
    background: rgba(0, 206, 209, 0.12);
    color: #007a7c;
}

.tag-century {
    background: rgba(255, 165, 0, 0.15);
    color: #8a5000;
}

.profile-bio {
    font-size: 1rem;
    line-height: 1.75;
    color: #333;
    margin: 0 0 1rem;
    clear: none;
}

.profile-source {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
    clear: both;
}

.profile-source a {
    color: #888;
    font-weight: normal;
    text-decoration: underline;
}

.linked-url-card {
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #6A0DAD;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    clear: both;
    text-align: center;
    box-shadow: 0 4px 10px rgba(106, 13, 173, 0.08);
}

.linked-url-label {
    font-size: 0.85rem;
    color: #555;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.linked-url-short {
    font-size: 1.25rem;
    margin: 0 0 1rem;
}

.linked-url-short a {
    color: #6A0DAD;
    font-weight: bold;
    word-break: break-all;
}

.visit-btn {
    display: inline-block;
    text-decoration: none;
}

@media (max-width: 600px) {
    .analytics-summary {
        font-size: 0.9rem;
    }

    .analytics-table thead {
        display: none;
    }

    .analytics-table tr {
        display: block;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 12px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    }

    .analytics-table td {
        display: block;
        text-align: left;
        padding: 0.25rem 0;
        border: none;
    }

    .analytics-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #6A0DAD;
        display: block;
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
    }

    .analytics-table .url-tooltip {
        white-space: normal;
        word-break: break-all;
    }
}

@media (max-width: 600px) {
    .profile-portrait-wrapper {
        float: none;
        margin: 0 auto 1rem;
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0.25rem;
        margin-top: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    input[type="url"], input[type="text"], textarea, button {
        font-size: 1rem;
        padding: 0.75rem;
    }

    table, footer {
        font-size: 0.9rem;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

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

    .stats {
        flex-direction: column;
        gap: 1rem;
    }
}
