/**
 * GMB Club Connect - Admin Styles
 */

/* Conditional Layout Options */
.gmb-option-row {
    transition: opacity 0.2s, background 0.2s;
}

.gmb-option-row[style*="display: none"] {
    display: none !important;
}

/* Reset & Base */
.gmb-cc-admin {
    max-width: 1200px;
}

.gmb-cc-admin h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.gmb-cc-version {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Tabs */
.gmb-cc-tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid #c3c4c7;
}

.gmb-cc-tabs .nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
}

.gmb-cc-tabs .nav-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.gmb-cc-tabs .nav-tab-active {
    background: #fff;
    border-bottom-color: #fff;
}

/* Cards */
.gmb-cc-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.gmb-cc-card h2 {
    margin: 0 0 15px;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gmb-cc-card h3 {
    margin: 0 0 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Grid layouts */
.gmb-cc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.gmb-cc-two-columns {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.gmb-cc-main-column {}
.gmb-cc-sidebar-column {}

@media (max-width: 960px) {
    .gmb-cc-two-columns {
        grid-template-columns: 1fr;
    }
}

/* Badges */
.gmb-cc-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.badge-success, .gmb-cc-badge.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning, .gmb-cc-badge.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-error, .gmb-cc-badge.badge-error {
    background: #f8d7da;
    color: #721c24;
}

/* Status */
.gmb-cc-status-success {
    color: #00a32a;
    font-weight: 600;
}

.gmb-cc-status-error {
    color: #d63638;
    font-weight: 600;
}

/* Forms */
.gmb-cc-form .form-table th {
    width: 180px;
    padding: 15px 10px 15px 0;
}

.gmb-cc-key-wrapper {
    display: flex;
    gap: 5px;
}

.gmb-cc-key-wrapper input {
    flex: 1;
}

/* Shortcode box */
.gmb-cc-shortcode-box {
    display: block;
    background: #f6f7f7;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.gmb-cc-shortcode-box:hover {
    background: #e8e8e8;
}

.gmb-cc-param-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gmb-cc-param-list li {
    padding: 4px 0;
    font-size: 12px;
}

.gmb-cc-param-list code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Shortcode examples */
.gmb-cc-shortcode-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.gmb-cc-example {
    background: #f6f7f7;
    padding: 12px;
    border-radius: 4px;
}

.gmb-cc-example code {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
}

.gmb-cc-example span {
    font-size: 11px;
    color: #666;
}

/* ========== LAYOUTS TAB ========== */
.gmb-cc-layouts-intro {
    margin-bottom: 20px;
    color: #666;
}

.gmb-cc-layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gmb-cc-layout-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gmb-cc-layout-card:hover {
    border-color: #4285F4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
    transform: translateY(-2px);
}

.gmb-cc-layout-preview {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.gmb-cc-layout-preview svg {
    width: 100%;
    height: 120px;
    display: block;
}

.gmb-cc-layout-info {
    padding: 15px;
}

.gmb-cc-layout-info h3 {
    margin: 0 0 5px;
    font-size: 14px;
    color: #202124;
}

.gmb-cc-layout-info p {
    margin: 0 0 10px;
    font-size: 12px;
    color: #5f6368;
}

.gmb-cc-layout-info code {
    display: block;
    background: #f1f3f4;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 11px;
    color: #1a73e8;
}

/* Licence required */
.gmb-cc-license-required {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.gmb-cc-license-required .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d63638;
    margin-bottom: 15px;
}

.gmb-cc-license-required h2 {
    margin: 0 0 10px;
}

.gmb-cc-license-required p {
    color: #666;
    margin-bottom: 20px;
}

/* Licence tab */
.gmb-cc-license-status {
    margin-bottom: 20px;
}

.gmb-cc-license-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.gmb-cc-license-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.gmb-cc-license-form input {
    flex: 1;
    min-width: 300px;
}

/* Logs */
.gmb-cc-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.gmb-cc-logs-header form {
    display: flex;
    gap: 8px;
}

/* Dashboard */
.gmb-cc-dashboard .gmb-cc-card h2 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Footer */
.gmb-cc-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #c3c4c7;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.gmb-cc-footer a {
    color: #2271b1;
    text-decoration: none;
}

/* Status indicators */
#gmb-reviews-status,
#gmb-cache-status,
#gmb-save-status,
#gmb-license-status {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    font-size: 13px;
}

#gmb-reviews-status.success,
#gmb-cache-status.success,
#gmb-save-status.success,
#gmb-license-status.success {
    color: #00a32a;
}

#gmb-reviews-status.error,
#gmb-cache-status.error,
#gmb-save-status.error,
#gmb-license-status.error {
    color: #d63638;
}

/* Loading spinner */
.gmb-cc-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: gmb-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes gmb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 782px) {
    .gmb-cc-tabs .nav-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .gmb-cc-tabs .nav-tab .dashicons {
        display: none;
    }
    
    .gmb-cc-layouts-grid {
        grid-template-columns: 1fr;
    }
    
    .gmb-cc-license-form input {
        min-width: 100%;
    }
}

/* ========== LAYOUT CONFIG MODAL ========== */
.gmb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gmb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.gmb-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gmb-modal-in 0.25s ease;
}

@keyframes gmb-modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gmb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.gmb-modal-header h2 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gmb-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.gmb-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.gmb-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.gmb-option-group {
    margin-bottom: 16px;
    display: none; /* Hidden by default, shown by JS */
}

.gmb-option-group.visible {
    display: block;
}

.gmb-option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.gmb-option-group input[type="checkbox"] + span,
.gmb-option-group label > input[type="checkbox"] {
    margin-right: 4px;
}

.gmb-option-group input[type="number"],
.gmb-option-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gmb-option-group input[type="number"]:focus,
.gmb-option-group select:focus {
    outline: none;
    border-color: #4285F4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.gmb-option-group input[type="color"] {
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
}

.gmb-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.gmb-shortcode-result label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.gmb-shortcode-output {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.gmb-shortcode-output code {
    flex: 1;
    background: #1f2937;
    color: #10b981;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Monaco', 'Consolas', monospace;
    word-break: break-all;
    display: flex;
    align-items: center;
}

.gmb-shortcode-output .button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 16px;
    white-space: nowrap;
}

.gmb-shortcode-output .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Layout card button */
.gmb-cc-layout-info .gmb-configure-layout {
    width: 100%;
    margin-top: 8px;
}

/* Copy success animation */
.gmb-copy-success {
    animation: gmb-pulse-green 0.5s ease;
}

@keyframes gmb-pulse-green {
    0%, 100% { background-color: #2271b1; }
    50% { background-color: #00a32a; }
}

/* Mobile modal */
@media (max-width: 600px) {
    .gmb-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .gmb-shortcode-output {
        flex-direction: column;
    }
    
    .gmb-shortcode-output .button {
        justify-content: center;
    }
}
