/**
 * Settings Tabs
 * CodeSig: sgketg
 * Author: G & D Enterprises, Inc.
 */

/* Tab Navigation */
.joan-nav-tab-wrapper {
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.joan-nav-tab-wrapper .nav-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #555;
    padding: 15px 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.joan-nav-tab-wrapper .nav-tab:hover {
    background: rgba(0, 115, 170, 0.1);
    color: #0073aa;
    border-bottom-color: rgba(0, 115, 170, 0.3);
}

.joan-nav-tab-wrapper .nav-tab.nav-tab-active {
    background: white;
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: 700;
}

.joan-nav-tab-wrapper .nav-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Tab Content */
.joan-tab-content {
    background: white;
    padding: 25px;
    border: 1px solid #ccd0d4;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Settings Sections */
.joan-settings-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.joan-settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.joan-settings-section h2 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f4fd;
    display: inline-block;
}

.joan-settings-section .description {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.05em;
}

/* Form Table Enhancements */
.joan-tab-content .form-table th {
    width: 200px;
    font-weight: 600;
    color: #2c3e50;
    padding: 20px 10px 20px 0;
}

.joan-tab-content .form-table td {
    padding: 20px 10px;
}

.joan-tab-content .form-table fieldset label {
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

.joan-tab-content .form-table fieldset label input[type="radio"],
.joan-tab-content .form-table fieldset label input[type="checkbox"] {
    margin-right: 8px;
}

/* Shortcodes Grid */
.joan-shortcodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.joan-shortcode-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.joan-shortcode-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.joan-shortcode-item h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.joan-shortcode-copy {
    display: block;
    background: #2c3e50;
    color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 10px 0;
    word-break: break-all;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.joan-shortcode-copy:hover {
    background: #34495e;
}

.joan-shortcode-copy::after {
    content: "Click to copy";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.joan-shortcode-copy:hover::after {
    opacity: 1;
}

.joan-shortcode-item p {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
}

/* CSS Examples */
.joan-css-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.joan-css-example {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

.joan-css-example h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f4fd;
}

.joan-css-example pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.joan-css-example code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Custom CSS Textarea */
.joan-tab-content textarea.code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #2c3e50;
    color: #ecf0f1;
    border: 1px solid #34495e;
    border-radius: 6px;
    padding: 15px;
    resize: vertical;
    min-height: 300px;
}

.joan-tab-content textarea.code:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    outline: none;
}

/* Submit Button Styling */
.joan-tab-content .submit {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.joan-tab-content .submit .button-primary {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.joan-tab-content .submit .button-primary:hover {
    background: linear-gradient(135deg, #005177 0%, #003d5c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

/* Advertisement Tab Specific Styles */
.joan-ads-intro {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    border: 1px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.joan-ads-intro h2 {
    color: #0073aa;
    margin-top: 0;
    margin-bottom: 12px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .joan-shortcodes-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .joan-css-examples {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .joan-nav-tab-wrapper .nav-tab {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .joan-nav-tab-wrapper .nav-tab .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .joan-tab-content {
        padding: 20px 15px;
    }
    
    .joan-tab-content .form-table th {
        width: auto;
        display: block;
        padding: 10px 0 5px 0;
    }
    
    .joan-tab-content .form-table td {
        display: block;
        padding: 5px 0 15px 0;
    }
    
    .joan-shortcodes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .joan-shortcode-copy {
        font-size: 12px;
        padding: 10px 12px;
        word-break: break-all;
    }
    
    .joan-shortcode-copy::after {
        display: none;
    }
    
    .joan-css-example pre {
        font-size: 12px;
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .joan-nav-tab-wrapper {
        display: flex;
        flex-wrap: wrap;
    }
    
    .joan-nav-tab-wrapper .nav-tab {
        flex: 1;
        text-align: center;
        min-width: 120px;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .joan-tab-content {
        padding: 15px 10px;
    }
    
    .joan-settings-section h2 {
        font-size: 1.2em;
    }
    
    .joan-tab-content textarea.code {
        font-size: 12px;
        min-height: 250px;
    }
}

/* Copy to Clipboard Animation */
.joan-shortcode-copied {
    background: #27ae60 !important;
    animation: joan-copied 0.5s ease;
}

@keyframes joan-copied {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Focus Styles for Accessibility */
.joan-nav-tab-wrapper .nav-tab:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.joan-shortcode-copy:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .joan-nav-tab-wrapper .nav-tab {
        border: 2px solid #000;
    }
    
    .joan-nav-tab-wrapper .nav-tab.nav-tab-active {
        background: #000;
        color: #fff;
    }
    
    .joan-shortcode-copy {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .joan-nav-tab-wrapper,
    .joan-tab-content .submit {
        display: none;
    }
    
    .joan-tab-content {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .joan-shortcode-copy {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #ccc;
    }
}