/**
 * Settings General - Enhanced Tab Design v4.0
 * TAB'LAR DAHA BELİRGİN - GÖRSEL İYİLEŞTİRME
 * SADECE CSS - Business Logic Korunur
 * 
 * @author selcukmart
 * @version 4.0 - Enhanced Visibility & UX
 * @date 2025-11-16
 */

/* ==========================================
   PORTLET OVERRIDES
   ========================================== */

/*.portlet.light.bordered {*/
/*    border: none;*/
/*    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);*/
/*    border-radius: 16px;*/
/*    overflow: visible;*/
/*}*/

/*.portlet.light .portlet-title {*/
/*    background: white;*/
/*    padding: 25px 30px;*/
/*    border-radius: 16px 16px 0 0;*/
/*    border-bottom: 1px solid #f1f3f5;*/
/*}*/

/*.portlet.light .portlet-title .caption-subject {*/
/*    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
/*    -webkit-background-clip: text;*/
/*    -webkit-text-fill-color: transparent;*/
/*    background-clip: text;*/
/*    font-size: 28px;*/
/*    font-weight: 800;*/
/*    letter-spacing: -0.5px;*/
/*}*/

/*.portlet.light .portlet-body {*/
/*    padding: 30px;*/
/*    background: white;*/
/*    border-radius: 0 0 16px 16px;*/
/*}*/

/* ==========================================
   TAB NAVIGATION - ENHANCED VISIBILITY
   ========================================== */

.portlet-body > .nav-tabs {
    background: #f8f9fa;
    border-radius: 14px;
    padding: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9ecef;
    margin-bottom: 30px !important;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}

/* Tab yapısının kendisi için subtle gradient background */
.portlet-body > .nav-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.02) 0%, transparent 100%);
    border-radius: 14px;
    pointer-events: none;
}

.portlet-body > .nav-tabs > li {
    float: none;
    margin-bottom: 0;
    flex: 1;
    min-width: 160px;
    position: relative;
}

/* INACTIVE TAB - Daha belirgin */
.portlet-body > .nav-tabs > li > a {
    padding: 16px 22px;
    margin: 0;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    color: #495057;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.2px;
}

/* Inactive tab için subtle gradient hint */
.portlet-body > .nav-tabs > li > a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* HOVER STATE - Çok daha belirgin */
.portlet-body > .nav-tabs > li > a:hover {
    background: white;
    color: #667eea;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.20);
}

.portlet-body > .nav-tabs > li > a:hover::before {
    opacity: 1;
}

/* ACTIVE TAB - Maksimum görünürlük */
.portlet-body > .nav-tabs > li.active > a,
.portlet-body > .nav-tabs > li.active > a:hover,
.portlet-body > .nav-tabs > li.active > a:focus {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45),
                0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
    font-weight: 800;
    letter-spacing: 0.3px;
}

/* Active tab için glow effect */
.portlet-body > .nav-tabs > li.active > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px 2px 0 0;
}

/* Active tab için pulse animation (optional - subtle) */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45),
                    0 0 0 4px rgba(102, 126, 234, 0.15);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5),
                    0 0 0 4px rgba(102, 126, 234, 0.2);
    }
}

.portlet-body > .nav-tabs > li.active > a {
    animation: subtlePulse 3s ease-in-out infinite;
}

/* ==========================================
   TAB CONTENT AREA
   ========================================== */

.portlet-body > .tab-content {
    background: transparent;
    border: none;
    padding: 0;
}

.portlet-body > .tab-content > .tab-pane {
    animation: fadeInContent 0.5s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   FORM STYLING
   ========================================== */

.tab-content .form {
    background: transparent;
    padding: 0;
}

.tab-content .form-horizontal {
    background: transparent;
}

.tab-content .form-body {
    padding: 0;
}

.tab-content .form-body > .row {
    margin: 0 -10px;
}

/* ==========================================
   FORM ROW (2 Column Grid)
   ========================================== */

.tab-content .form-body .row .row {
    background: white;
    border-radius: 14px;
    padding: 25px 20px;
    margin: 0 10px 20px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f3f5;
    transition: all 0.3s ease;
}

.tab-content .form-body .row .row:hover {
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.tab-content .form-body .row .row .col-sm-6 {
    padding: 0 15px;
}

/* ==========================================
   FORM ELEMENTS - LABELS
   ========================================== */

.tab-content .form-body .col-sm-6 {
    margin-bottom: 0;
}

/* Title/Label styling - ilk satır */
.tab-content .form-body .col-sm-6 > *:first-child {
    font-weight: 700;
    color: #212529;
    margin-bottom: 12px;
    display: block;
    font-size: 14px;
    letter-spacing: -0.2px;
}

/* ==========================================
   BUTTONS - GRADIENT STYLE
   ========================================== */

.tab-content .btn,
/*.tab-content .editable-click,*/
.tab-content a.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.3px;
}

.tab-content .btn:hover,
/*.tab-content .editable-click:hover,*/
.tab-content a.btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
    transform: translateY(-2px);
    color: white !important;
    text-decoration: none;
}

.tab-content .btn:active,
/*.tab-content .editable-click:active,*/
.tab-content a.btn:active {
    transform: translateY(0);
}

/* ==========================================
   EDITABLE ELEMENTS
   ========================================== */

/*.tab-content .editable {*/
/*    color: #212529;*/
/*    font-weight: 600;*/
/*    font-size: 14px;*/
/*    text-decoration: none;*/
/*    display: inline-block;*/
/*}*/

/*.tab-content .editable-empty {*/
/*    color: #6c757d;*/
/*    font-style: italic;*/
/*}*/

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

.tab-content .badge {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-content .badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.tab-content .badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

.tab-content .badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.tab-content .badge-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

/* ==========================================
   FORM CONTROLS
   ========================================== */

.tab-content .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 16px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-content .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

/* ==========================================
   SWITCH TOGGLE
   ========================================== */

.tab-content .bootstrap-switch {
    border-radius: 20px;
    border: 2px solid #e9ecef;
}

.tab-content .bootstrap-switch.bootstrap-switch-on {
    border-color: #667eea;
}

.tab-content .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ==========================================
   ALERTS
   ========================================== */

.portlet-body .alert {
    border-radius: 12px;
    border-left-width: 4px;
    font-weight: 500;
}

.portlet-body .alert-info {
    background: rgba(59, 130, 246, 0.08);
    border-left-color: #3b82f6;
    color: #1e40af;
}

.portlet-body .alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: #f59e0b;
    color: #92400e;
}

.portlet-body .alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: #10b981;
    color: #065f46;
}

.portlet-body .alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: #ef4444;
    color: #991b1b;
}

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

@media (max-width: 992px) {
    .portlet-body > .nav-tabs > li {
        min-width: 140px;
    }

    .portlet-body > .nav-tabs > li > a {
        padding: 14px 18px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .portlet-body > .nav-tabs {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .portlet-body > .nav-tabs > li {
        width: 100%;
        min-width: auto;
    }

    .portlet-body > .nav-tabs > li > a {
        padding: 14px 20px;
        font-size: 14px;
    }

    .portlet-body > .nav-tabs > li.active > a {
        transform: translateY(-2px);
    }

    .portlet.light .portlet-title {
        padding: 20px;
    }

    .portlet.light .portlet-title .caption-subject {
        font-size: 22px;
    }

    .portlet.light .portlet-body {
        padding: 20px;
    }

    .tab-content .form-body .row .row {
        padding: 20px 15px;
        margin: 0 0 15px 0;
    }
}

@media (max-width: 480px) {
    .portlet-body > .nav-tabs {
        padding: 6px;
        gap: 6px;
        margin-bottom: 20px !important;
    }

    .portlet-body > .nav-tabs > li > a {
        padding: 12px 16px;
        font-size: 13px;
    }

    .tab-content .form-body .row .row {
        padding: 15px;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .portlet.light.bordered,
    .tab-content .form-body .row .row {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .tab-content .btn,
    .tab-content .editable-click {
        display: none;
    }

    .portlet-body > .nav-tabs > li.active > a {
        animation: none;
    }
}

/* ==========================================
   PERFORMANCE & ACCESSIBILITY
   ========================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .portlet-body > .nav-tabs > li.active > a {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .portlet-body > .nav-tabs > li > a {
        border-width: 3px;
    }

    .portlet-body > .nav-tabs > li.active > a {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* Focus visible for keyboard navigation */
.portlet-body > .nav-tabs > li > a:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* ==========================================
   UTILITY OVERRIDES
   ========================================== */

.form-control {
    height: auto !important;
}

.api-key-input-group-btn {
    line-height: 24px !important;
}

/* Select2 dropdown styling */
.select2-container--default .select2-selection--single {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    height: auto;
    padding: 8px 16px;
}

.select2-container--default .select2-selection--single:focus {
    border-color: #667eea;
}

/* Datepicker styling */
.datepicker table tr td.active.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Summernote editor */
.note-editor.note-frame {
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

.note-editor.note-frame:focus-within {
    border-color: #667eea;
}
