/**
 * Club Directory Manager - Frontend CSS
 * Version 2.0 - With Frontend Edit Form Styling
 */

/* ========================================
   DIRECTORY LISTING STYLES
   ======================================== */

/* Main Container */
.cdm-club-directory {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    position: relative;
}

/* Filters Section */
.cdm-filters-section {
    background: white;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cdm-filters-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Search Box - 100% Width */
.cdm-search-box {
    width: 100%;
}

.cdm-search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.cdm-search-box input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Filters Row */
.cdm-filters-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.cdm-filters {
    display: flex;
    gap: 15px;
    flex: 1;
}

.cdm-filters select {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Filter Buttons */
.cdm-filter-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cdm-filter-btn, .cdm-export-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cdm-filter-btn:hover, .cdm-export-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cdm-clear-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.cdm-clear-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* Table Styling */
.cdm-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cdm-clubs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cdm-clubs-table thead {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
}

.cdm-clubs-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.cdm-clubs-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cdm-clubs-table tbody tr:hover {
    background: #f8f9fa;
}

.cdm-clubs-table td {
    padding: 12px;
}

.cdm-club-name a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.cdm-club-name a:hover {
    text-decoration: underline;
}

/* Pagination */
.cdm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.cdm-pagination a,
.cdm-pagination span.current {
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-decoration: none;
    color: #0073aa;
    background: white;
    transition: all 0.3s ease;
}

.cdm-pagination a:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.cdm-pagination span.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* ========================================
   EDIT BUTTON ON CLUB PAGE
   ======================================== */

.cdm-edit-club-btn {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin: 15px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cdm-edit-club-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white;
    text-decoration: none;
}

/* ========================================
   FRONTEND EDIT FORM STYLES
   ======================================== */

.cdm-frontend-edit-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.cdm-edit-header {
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 20px;
}

.cdm-edit-header h1 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.cdm-edit-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 15px;
}

.cdm-back-link {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cdm-back-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Success Message */
.cdm-success-message {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cdm-success-message p {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

/* Form Container */
.cdm-frontend-edit-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 0;
}

/* Form Sections */
.cdm-form-section {
    padding: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.cdm-form-section:last-of-type {
    border-bottom: none;
}

.cdm-section-title {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
    font-weight: 700;
}

/* Form Rows */
.cdm-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cdm-form-row:last-child {
    margin-bottom: 0;
}

/* Form Groups */
.cdm-form-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cdm-col-12 {
    flex-basis: 100%;
}

.cdm-col-6 {
    flex-basis: calc(50% - 10px);
    min-width: 250px;
}

.cdm-col-4 {
    flex-basis: calc(33.333% - 14px);
    min-width: 200px;
}

.cdm-form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.cdm-form-group .required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 3px;
}

/* Form Inputs */
.cdm-form-group input[type="text"],
.cdm-form-group input[type="email"],
.cdm-form-group input[type="url"],
.cdm-form-group input[type="tel"],
.cdm-form-group input[type="time"],
.cdm-form-group input[type="number"],
.cdm-form-group select,
.cdm-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.cdm-form-group input:focus,
.cdm-form-group select:focus,
.cdm-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cdm-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox Group */
.cdm-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 8px;
}

.cdm-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    transition: color 0.3s ease;
}

.cdm-checkbox-label:hover {
    color: #0073aa;
}

.cdm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

/* Activity Log Display */
.cdm-activity-log-display {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 15px 20px;
    margin: 30px;
    border-radius: 6px;
}

.cdm-activity-log-display p {
    margin: 0;
    color: #495057;
    font-size: 14px;
}

.cdm-activity-log-display strong {
    color: #2c3e50;
}

/* Form Actions */
.cdm-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    flex-wrap: wrap;
}

.cdm-submit-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cdm-submit-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.cdm-submit-btn:active {
    transform: translateY(0);
}

.cdm-cancel-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cdm-cancel-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media screen and (max-width: 1024px) {
    .cdm-filters {
        flex-wrap: wrap;
    }
    
    .cdm-filters select {
        flex-basis: calc(50% - 7.5px);
    }
    
    .cdm-col-4 {
        flex-basis: calc(50% - 10px);
    }
}

@media screen and (max-width: 768px) {
    .cdm-filters-section {
        padding: 20px;
    }
    
    .cdm-filters-row {
        flex-direction: column;
    }
    
    .cdm-filters {
        width: 100%;
        flex-direction: column;
    }
    
    .cdm-filters select {
        flex-basis: 100%;
        width: 100%;
    }
    
    .cdm-filter-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .cdm-filter-btn,
    .cdm-clear-btn,
    .cdm-export-btn {
        flex: 1;
        text-align: center;
    }
    
    .cdm-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cdm-clubs-table {
        min-width: 800px;
    }
    
    /* Frontend Edit Form */
    .cdm-frontend-edit-wrapper {
        padding: 20px 15px;
    }
    
    .cdm-edit-header h1 {
        font-size: 24px;
    }
    
    .cdm-form-section {
        padding: 20px 15px;
    }
    
    .cdm-section-title {
        font-size: 20px;
    }
    
    .cdm-col-6,
    .cdm-col-4 {
        flex-basis: 100%;
        min-width: 100%;
    }
    
    .cdm-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cdm-activity-log-display {
        margin: 20px 15px;
    }
    
    .cdm-form-actions {
        flex-direction: column;
        padding: 20px;
    }
    
    .cdm-submit-btn,
    .cdm-cancel-btn {
        width: 100%;
        padding: 15px 20px;
    }
}

@media screen and (max-width: 480px) {
    .cdm-edit-header h1 {
        font-size: 20px;
    }
    
    .cdm-edit-subtitle {
        font-size: 16px;
    }
    
    .cdm-section-title {
        font-size: 18px;
    }
    
    .cdm-pagination a,
    .cdm-pagination span.current {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .cdm-filters-section,
    .cdm-filter-actions,
    .cdm-edit-club-btn,
    .cdm-form-actions,
    .cdm-back-link {
        display: none;
    }
    
    .cdm-frontend-edit-form {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Accessibility */
.cdm-form-group input:focus,
.cdm-form-group select:focus,
.cdm-form-group textarea:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading State */
.cdm-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #6c757d;
}

.cdm-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}