/* ========================================
   TERRAMONT TRAILTRACKER STYLES
   ======================================== */

/* ========================================
   BASE LAYOUT & TYPOGRAPHY
   ======================================== */

.terramont-container {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.terramont-main-title {
    font-size: 32px;
    font-weight: 900 !important;
    color: #000000;
    margin-bottom: 100px;
    text-align: center;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .terramont-main-title {
        margin-bottom: 50px;
    }
}

.terramont-section-title {
    font-size: 28px;
    font-weight: 900 !important;
    color: #000000 !important;
    margin-bottom: 25px;
    text-transform: uppercase !important;
    text-align: center;
}

.terramont-badges-subtitle {
    font-size: 24px;
    font-weight: 600;
    margin: 30px 0 20px;
    text-align: center;
}

.terramont-highlight {
    color: #83a842;
    font-weight: 900;
    text-align: center;
}

@media (max-width: 768px) {
    .terramont-highlight {
        font-size: 20px;
    }
}

/* ========================================
   AUTHENTICATION & LOGIN
   ======================================== */

.terramont-login-required {
    background-color: #f2f2f2;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    margin: 30px 0;
    font-size: 18px;
    font-weight: 500;
}

/* ========================================
   PERFORMANCE SECTION
   ======================================== */

.terramont-profile-picture-wrapper {
    position: relative;
}

.terramont-upload-icon-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-style: 2px solid white;
    transition: all 0.3s ease;
}

.terramont-upload-icon-overlay:hover {
    transform: scale(1.1);
    cursor: pointer;
}

.terramont-user-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.terramont-profile-picture-container {
    flex-shrink: 0;
}

.terramont-vertical-divider {
    width: 2.8px;
    height: 100px;
    background: #000000;
    border-radius: 5px;
    flex-shrink: 0;
}

.terramont-user-name {
    margin: 0;
    font-size: 34px !important;
    font-weight: 900 !important;
    color: #000000;
    text-transform: uppercase !important;
}

@media (max-width: 768px) {
    .terramont-user-name {
        text-align: center;
    }
}

.terramont-status {
    margin: 0;
    font-size:15px;
    text-transform: uppercase !important;
    display: inline !important;
    color: #B0B3B8;
}

.terramont-details {
    text-align: left; 
}

@media (max-width: 768px) {
    .terramont-details {
        text-align: center;
    }
}

.terramont-separator {
    font-size: 1em;
    color: #B0B3B8;
}

.terramont-membership-year {
    font-size:15px;
    text-transform: uppercase !important;
    display: inline !important;
    color: #B0B3B8;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    .terramont-user-profile-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .terramont-profile-picture-container {
        align-self: center;
    }
    
    .terramont-vertical-divider {
        display: none;
    }
    
    .terramont-user-name {
        font-size: 24px !important;
    }

    .terramont-main-title {
        font-size: 38px !important;
    }
    
    .terramont-status,
    .terramont-separator,
    .terramont-membership-year {
        font-size: 14px;
    }
}

.terramont-performance-section {
    margin-bottom: 50px;
    text-align: center;
}

.terramont-performance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .terramont-performance-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.terramont-performance-item {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.terramont-performance-item.trail-marker {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
}

.terramont-performance-icon {
    margin-bottom: 20px;
    font-size: 40px;
    color: #83a842;
}

.terramont-performance-value {
    font-size: 32px;
    font-weight: 800;
    color: #83a842;
    margin-bottom: 8px;
}
@media (max-width: 768px) {
    .terramont-performance-value {
        font-size: 24px !important;
    }
}

.terramont-status-table-link {
    text-decoration: underline !important;
    line-height: 0.95 !important;
    cursor: pointer;
    font-style: italic !important;
    color: #95c11f !important;
}

@media (min-width: 768px) {
    .terramont-status-table-link {
        padding-top: 15px !important;
    }
}

.terramont-status-table-link {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #B0B3B8;
    padding-top:6px;
    line-height: 1;
}

.terramont-performance-label {
    font-size: 18px !important;
    font-weight: 500 !important;
    color: #B0B3B8;
    padding-top:6px;
    line-height: 1;
}

@media (max-width: 768px) {
    .terramont-status-table-link {
        font-size:10px !important;
    }

    .terramont-performance-label {
        font-size:14px !important;
    }
}

.terramont-performance-text {
    font-size: 22px;
    font-weight: 500;
    color: #444;
}

/* ========================================
   ACTIVITY HISTORY SECTION
   ======================================== */

.terramont-history-section {
    margin-top:100px !important;
    margin-bottom: 50px;
    text-align: center;
}

@media (max-width: 768px) {
    .terramont-history-section {
        margin-top:50px !important;
    }
}

.terramont-history-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .terramont-history-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.terramont-activity-card {
    background-color: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.terramont-activity-image {
    height: 0;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    background-size: cover;
    background-position: center;
    position: relative;
}

.terramont-activity-date {
    position: absolute;
    right: 10px;
    top: 10px;
    background-color: rgba(131, 168, 66, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.terramont-activity-content {
    padding: 10px 0px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.terramont-activity-title {
    font-size: 20px;
    margin-bottom: 15px;
    margin-top: 0px !important
}

.terramont-activity-title a {
    font-weight: 800 !important;
    color: #444;
    text-decoration: none;
}

.terramont-activity-title a:hover {
    color: #83a842;
}

.terramont-activity-stats {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
}


.terramont-activity-stat {
    margin:2px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .terramont-activity-stats {
        gap: 0px;
    }

    .terramont-activity-stat {
        gap: 0px;
    }

    .terramont-activity-stat span {
        font-size: 14px;
    }
}

@media (max-width: 389px) {
    .terramont-activity-stat span {
        font-size: 10px;
    }
}

.terramont-stat-icon {
    font-size: 18px;
    color: #83a842;
    width: 25px;
    text-align: center;
}

.terramont-stat-value {
    font-size: 16px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.terramont-activity-stat.difficulty .terramont-stat-value {
    background-color: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.terramont-empty-history {
    background-color: #f9f9f9;
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    color: #555;
    font-size: 18px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    margin: 0 auto;
    max-width: 600px;
}

/* ========================================
   ACTIVITY SUMMARY CARDS
   ======================================== */

.terramont-activity-summary-card {
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.terramont-activity-summary-content {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.terramont-activity-summary-item {
    background-color: #fff;
    border: 2px solid #83a842;
    color: #83a842;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.terramont-activity-name {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.terramont-activity-count {
    background-color: #83a842;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* ========================================
   BADGES SECTION
   ======================================== */

.terramont-badge-img img {
    width: 250px !important;
    height: 250px !important;
}

.terramont-badge-category {
    text-transform: uppercase;
    margin-top: 50px;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 800;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.terramont-badge-category::before,
.terramont-badge-category::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, black);
}

.terramont-badge-category::after {
    background: linear-gradient(to left, transparent, black);
}

@media (max-width: 768px) {
    .terramont-badges-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1px !important;
        padding: 0 0px !important;
    }
    
    .terramont-badge-img img {
        width: 100px !important;
        height: 100px !important;
    }
}

.terramont-badge-img.locked {
    filter: grayscale(100%);
    opacity: 0.5;
}

.terramont-badges-section {
    margin-top: 100px !important;
    margin-bottom: 50px;
    text-align: center;
}

@media (max-width: 768px) {
    .terramont-badges-section {
        margin-top:50px !important;
    }
}

.terramont-badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   LEADERBOARD SECTION
   ======================================== */

.terramont-date-range {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #555;
    margin-bottom: 30px;
}

.terramont-leaderboard-photo {
    aspect-ratio: 1 / 1;
    min-width: 80px !important;
    max-width: 80px !important;
    width: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    height: 80px !important;
    overflow: hidden;
}

.terramont-leaderboard-photo img {
    aspect-ratio: 1 / 1;
    min-width: 80px !important;
    max-width: 80px !important;
    width: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    height: 80px !important;
    overflow: hidden;
}

.terramont-leaderboard-item {
    position: relative;
    padding-left: 60px; /* Space for rank */
}

.terramont-rank {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 700;
    color: #555;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f0f0;
}

.terramont-rank-top {
    background-color: #83a842;
    color: #fff;
}

.terramont-leaderboard-name {
    font-size: 18px;
    font-weight: 600;
    color: #444;
}

/* ========================================
   FORM FILTERS
   ======================================== */

.terramont-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.terramont-filter-item {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.terramont-filter-label {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.terramont-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.terramont-filter-submit {
    background-color: #83a842;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    align-self: flex-end;
}

.terramont-filter-submit:hover {
    background-color: #6a8935;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .terramont-performance-grid,
    .terramont-history-grid,
    .terramont-badges-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets */
@media (max-width: 768px) {
    .terramont-performance-grid,
    .terramont-history-grid,
    .terramont-badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .terramont-performance-item.trail-marker {
        flex-direction: column;
    }
    
    .terramont-filter-form {
        flex-direction: column;
    }
    
    .terramont-filter-item {
        width: 100%;
    }
    
    .terramont-leaderboard-item {
        padding-left: 50px;
    }
    
    .terramont-rank {
        left: 10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .terramont-performance-grid,
    .terramont-history-grid,
    .terramont-badges-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   CHAMPIONSHIP STYLES - IMPROVED VERSION
   ======================================== */

.terramont-championships-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.terramont-championship-section {
    margin-top:50px !important;
    margin-bottom: 50px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8ede0;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .terramont-championship-section {
        margin-top: 50px !important;
    }
    .terramont-championships-container {
        padding: 0px !important;
    }
}

.terramont-championship-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #83a842, #a4c158, #83a842);
}

.terramont-championship-header {
    text-align: center;
    margin-bottom: 30px;
}

.terramont-championship-title {
    margin-top: 0px !important;
    font-size: 32px;
    font-weight: 900 !important;
    color: #000000 !important;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.terramont-championship-title i {
    font-size: 28px;
    color: #d4af37;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.terramont-championship-info {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
}

.terramont-championship-criteria,
.terramont-championship-period {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(131, 168, 66, 0.2);
    border-radius: 7px !important;
    line-height: 1;
}

.terramont-championship-criteria i,
.terramont-championship-period i {
    color: #83a842;
    font-size: 14px;
}

.terramont-championship-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.terramont-leaderboard-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ede0;
    position: relative;
    transition: all 0.3s ease;
}

.terramont-leaderboard-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.terramont-leaderboard-item.current-user {
    background: white !important;
    border: 2px solid #83a842;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(131, 168, 66, 0.2);
}

.terramont-leaderboard-item.current-user:hover {
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 10px 30px rgba(131, 168, 66, 0.25);
}

.terramont-rank {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #83a842, #a4c158);
    box-shadow: 0 4px 15px rgba(131, 168, 66, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.terramont-rank:hover {
    transform: scale(1.1);
}

.terramont-leaderboard-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.terramont-leaderboard-user {
    display: flex;
    flex-direction: row;
    flex: 1;
    justify-content: center;
    margin-bottom: 0px;
}

.terramont-leaderboard-rank {
    font-size: 26px !important;
    font-weight: 900;
    color: #444;
    margin-bottom: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-right: 40px;
}

@media (max-width: 768px) {
    .terramont-leaderboard-rank {
        font-size: 20px !important;
    }
}

.terramont-leaderboard-name i {
    color: #83a842;
    font-size: 16px;
}

.terramont-leaderboard-score {
    font-size: 26px !important;
    font-weight: 900 !important;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 30px;
}

@media (max-width: 768px) {
    .terramont-leaderboard-rank {
        margin-right: 20px;
    }

    .terramont-leaderboard-score {
        margin-left: 10px;
    }
}

.terramont-no-championships {
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f7f0 100%);
    padding: 40px;
    text-align: center;
    border-radius: 15px;
    color: #666;
    font-size: 18px;
    font-weight: 500;
    border: 1px solid #e8ede0;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Championship Admin Styles */
.championship-management {
    margin-bottom: 40px;
}

.championship-form-container {
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f7f0 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid #e8ede0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.championship-form {
    max-width: 800px;
}

.existing-championships {
    margin-top: 30px;
}

/* Animations */
@keyframes subtle-glow {
    0% {
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
    }
}

/* Responsive Design for Championships */
@media (max-width: 768px) {
    .terramont-championship-section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .terramont-championship-title {
        font-size: 28px;
        flex-direction: column;
        gap: 8px;
    }

    .terramont-championship-criteria,
    .terramont-championship-period {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .terramont-leaderboard-item {
        padding: 15px;
    }
    
    .terramont-rank-container {
        margin-right: 15px;
    }
    
    .terramont-rank {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .terramont-rank-top {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .terramont-leaderboard-name {
        font-size: 16px;
    }
    
    .terramont-leaderboard-score {
        font-size: 18px;
    }
    
    .terramont-leaderboard-content {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .terramont-leaderboard-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .championship-form-container {
        padding: 20px;
    }
    
    .terramont-championship-title {
        font-size: 24px;
    }
}