/*
Theme Name: Golf Rankings
Theme URI: https://example.com
Author: Golf Rankings Team
Author URI: https://example.com
Description: A clean, modern WordPress theme for golf course rankings and reviews. Inspired by top100golfcourses.com with a mobile-first approach.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: golf-rankings
Tags: custom-post-types, featured-images, responsive-layout, translation-ready
*/

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */

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

:root {
    --primary-color: #1d8348;
    --secondary-color: #27ae60;
    --accent-color: #f39c12;
    --text-dark: #1d1d1f;
    --text-medium: #424245;
    --text-light: #86868b;
    --bg-light: #f5f5f7;
    --bg-lighter: #fbfbfd;
    --white: #ffffff;
    --border-color: #d2d2d7;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.16);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: var(--text-dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.0834933333;
    letter-spacing: -0.003em;
    margin-bottom: 0.8em;
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.05;
}
h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.012em;
}
h3 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.009em;
}
h4 {
    font-size: 1.5rem;
    font-weight: 600;
}
h5 {
    font-size: 1.25rem;
    font-weight: 600;
}
h6 {
    font-size: 1.0625rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.2em;
    color: var(--text-medium);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
}

.container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 22px;
}

@media (min-width: 1441px) {
    .container {
        max-width: 1024px;
    }
    .container-wide {
        max-width: 1440px;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
}

.site-logo {
    flex-shrink: 0;
    padding: 12px 0;
}

.site-logo a {
    font-size: 1.3125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.site-logo a:hover {
    opacity: 0.8;
}

.main-navigation {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    align-items: center;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 400;
    padding: 12px 0;
    display: block;
    transition: var(--transition-fast);
    position: relative;
}

.main-navigation a:hover {
    color: var(--text-dark);
    opacity: 0.8;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    transform: scaleX(1);
}

/* ==========================================================================
   Header Actions & Search
   ========================================================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    order: 2;
}

.user-login-trigger,
.user-logout {
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 400;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 0;
    transition: var(--transition-fast);
}

.user-login-trigger:hover,
.user-logout:hover {
    opacity: 0.7;
}

.header-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    display: none;
    box-shadow: var(--shadow-md);
}

.header-search.active {
    display: block;
}

.search-form-inner {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-field {
    width: 100%;
    padding: 14px 50px 14px 20px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 980px;
    background: var(--bg-light);
    transition: var(--transition-fast);
}

.search-field:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
}

.search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--white);
}

.search-submit:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.05);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   Content
   ========================================================================== */

.site-main {
    padding: 0;
    min-height: 60vh;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background-color: var(--bg-light);
    color: var(--text-medium);
    padding: 2rem 0;
    margin-top: 6rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.site-footer a {
    color: var(--text-medium);
    transition: var(--transition-fast);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--primary-color);
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-links a {
    font-size: 0.875rem;
}

.footer-sep {
    color: var(--border-color);
    margin: 0 0.75rem;
}

.footer-bottom p {
    margin: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.footer-credit {
    margin-top: 0.5rem;
}

.footer-credit a {
    color: var(--text-light);
    font-size: 0.75rem;
}

.footer-credit a:hover {
    color: var(--primary-color);
}

/* Service Stations link in footer */
.footer-services-link {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
}

.footer-services-link a {
    color: var(--text-light);
    opacity: 0.6;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-services-link a:hover {
    opacity: 1;
    color: #f39c12;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 980px;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: -0.01em;
    min-width: 120px;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-content {
    padding: 1.75rem;
}

.card-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */

.grid {
    display: grid;
    gap: 2.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 734px) {
    .grid {
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1068px) {
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.625rem; }
}

@media (max-width: 734px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
    h3 { font-size: 1.5rem; }

    body {
        font-size: 16px;
    }

    .container {
        padding: 0 16px;
    }

    .site-header .container {
        flex-wrap: wrap;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 0.5rem;
    }

    .site-logo {
        grid-column: 1;
        justify-self: start;
    }

    .menu-toggle {
        display: flex;
        grid-column: 2;
        justify-self: center;
    }

    .header-actions {
        grid-column: 3;
        justify-self: end;
        gap: 1rem;
    }

    .header-actions a,
    .header-actions button {
        font-size: 0.875rem;
        padding: 8px 10px;
    }

    .main-navigation {
        display: none;
        width: 100%;
        grid-column: 1 / -1;
        background: var(--white);
        border-radius: 12px;
        margin-top: 12px;
        box-shadow: var(--shadow-md);
        position: static;
        transform: none;
        left: auto;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 12px 0;
    }

    .main-navigation li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        display: block;
        padding: 14px 22px;
        font-size: 1rem;
    }

    .main-navigation a::after {
        display: none;
    }
}

/* ==========================================================================
   Hero Video Background
   ========================================================================== */

.hero-video-section {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 80vh;
    min-height: 500px;
    max-height: 900px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #000;
}

.hero-video-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 177.78vh; /* 16:9 aspect ratio - height * 16/9 */
    height: 56.25vw; /* 16:9 aspect ratio - width * 9/16 */
    min-width: 100%;
    min-height: 100%;
    pointer-events: none;
    border: none;
}

.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--white);
    padding: 2rem;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--white);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.btn-hero {
    font-size: 1.125rem;
    padding: 16px 32px;
    background-color: var(--white);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

.btn-hero:hover {
    background-color: var(--white);
    color: var(--secondary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

/* Hero Video Responsive */
@media (max-width: 1068px) {
    .hero-video-section {
        height: 70vh;
        min-height: 450px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content p {
        font-size: 1.25rem;
    }
}

@media (max-width: 734px) {
    .hero-video-section {
        height: 60vh;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2.25rem;
    }

    .hero-content p {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }

    .btn-hero {
        font-size: 1rem;
        padding: 14px 28px;
    }
}

/* ==========================================================================
   Friend System Styles
   ========================================================================== */

/* Friend Requests Dropdown in Header */
.friend-requests-dropdown {
    position: relative;
}

.friend-requests-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.friend-requests-toggle:hover {
    background: var(--bg-light);
}

.friend-requests-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.friend-requests-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.friend-requests-dropdown.active .friend-requests-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.friend-requests-panel .panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-lighter);
}

.friend-requests-panel .panel-header h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

.friend-requests-panel .panel-content {
    max-height: 340px;
    overflow-y: auto;
}

.friend-requests-panel .loading-spinner {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.friend-requests-panel .loading-spinner .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.friend-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.friend-request-item:last-child {
    border-bottom: none;
}

.friend-request-item:hover {
    background: var(--bg-lighter);
}

.request-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.request-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.request-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.request-actions .btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.friend-requests-panel .no-requests {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Profile Friend Actions */
.profile-friend-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-friend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
}

.btn-friend.btn-pending {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border-color);
}

.btn-friend.btn-pending:hover {
    background: #fee;
    color: #c0392b;
    border-color: #e74c3c;
}

.friend-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(39, 174, 96, 0.1);
    color: var(--secondary-color);
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
}

.btn-unfriend {
    font-size: 13px;
    padding: 8px 16px;
    opacity: 0.7;
}

.btn-unfriend:hover {
    opacity: 1;
    background: #fee;
    color: #c0392b;
    border-color: #e74c3c;
}

.friend-request-respond {
    text-align: center;
}

.friend-request-respond .request-message {
    display: block;
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 12px;
}

.friend-request-respond .respond-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Private Info Locked Section */
.private-info-locked {
    background: var(--bg-lighter);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
}

.private-info-locked .locked-content {
    text-align: center;
    padding: 3rem 2rem;
}

.private-info-locked .locked-content svg {
    color: var(--text-light);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.private-info-locked .locked-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.private-info-locked .locked-content p {
    font-size: 15px;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.private-info-locked .request-pending-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 14px;
}

/* Friends Only Badge */
.friends-only-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(39, 174, 96, 0.1);
    color: var(--secondary-color);
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Contact Info Section */
.profile-contact-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-contact-section h2 svg {
    color: var(--secondary-color);
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-lighter);
    border-radius: 10px;
    transition: var(--transition-fast);
}

.contact-item:hover {
    background: var(--bg-light);
}

.contact-item svg {
    color: var(--text-light);
    flex-shrink: 0;
}

.contact-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 15px;
    word-break: break-all;
}

.contact-item a:hover {
    color: var(--primary-color);
}

/* Friend Action Button Animations */
.btn-friend,
.friend-status-badge,
.send-friend-request,
.accept-friend-request,
.reject-friend-request,
.cancel-friend-request,
.remove-friend {
    transition: var(--transition-fast);
}

.btn-friend:disabled,
.send-friend-request:disabled,
.accept-friend-request:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Friend System */
@media (max-width: 734px) {
    .friend-requests-panel {
        width: 290px;
        right: -60px;
    }

    .friend-request-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .request-actions {
        width: 100%;
    }

    .request-actions .btn-small {
        flex: 1;
        justify-content: center;
    }

    .profile-friend-actions {
        flex-direction: column;
    }

    .btn-friend {
        width: 100%;
        justify-content: center;
    }

    .friend-request-respond .respond-buttons {
        flex-direction: column;
    }

    .friend-request-respond .respond-buttons .btn {
        width: 100%;
    }
}

/* Friend System Notification Toast */
.friend-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--text-dark);
    color: var(--white);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-fast);
}

.friend-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.friend-notification.success {
    background: var(--secondary-color);
}

.friend-notification.error {
    background: #e74c3c;
}
