/* Table View Styles */
.table-view {
    padding: 20px;
    margin-top: 0px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Filter Styles */
.filter-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    position: sticky;
    z-index: 1;
}

.filter-mobile-toggle {
    display: none; /* Hidden on desktop */
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    border-radius: 12px;
    transition: background-color 0.2s;
}

.filter-mobile-toggle:hover {
    background-color: #f5f5f5;
}

.filter-mobile-toggle i {
    margin-right: 8px;
    color: #666;
}

.filter-content {
    padding: 0 20px 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.filter-dropdown {
    position: relative;
    width: auto; /* Allow auto width */
    min-width: 200px; /* Minimum width */
}

.filter-dropdown-button {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    min-width: 200px;
    white-space: nowrap; /* Prevent text wrapping */
}

.filter-dropdown-button:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.filter-dropdown-button:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto; /* Changed from 'right: 0' to allow auto width */
    min-width: 100%; /* At least as wide as the button */
    width: max-content; /* Auto width based on content */
    background: #fff;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.filter-dropdown-content.active {
    display: block;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background-color: #f8f9fa;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #007bff;
}

.filter-option span {
    font-size: 14px;
    color: #333;
    flex: 1;
    white-space: nowrap; /* Prevent text wrapping in options */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filter-mobile-toggle {
        display: block;
    }
    
    .filter-content {
        display: none;
        padding: 0 20px 20px 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-content.mobile-active {
        display: flex;
    }
    
    .filter-group {
        align-self: normal !important;
        min-width: auto;
        width: 100%;
        max-height: 45px !important;
        max-width: 100% !important;
    }
    
    .filter-dropdown-button {
        min-width: auto;
    }
}

.segment-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex: 0 1 auto;
    min-width: calc(300px + 44px); /* If header is 300px, section is at least 344px */
    /*min-width: max-content;*/
    flex-direction: column;
    /* Ensure header is above categories-grid */
    border: 2px solid #eee;
    /* Default border for segment sections */
    position: relative; /* Added for absolute positioning of header */
    margin-top: 15px; /* Add space for the floating header */
    box-sizing: border-box;
    z-index: 1;
}

.segment-header {
    /* Modern floating box design */
    position: absolute;
    top: -16px; /* Position above the segment section border */
    left: 20px; /* Align to the right */
    background: #fff;
    border: 2px solid #eee; /* Same as segment border */
    border-radius: 8px;
    padding: 2px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2; /* Ensure it's above other elements */
    /* Remove old styles: border-bottom, margin-bottom, padding-bottom */
}

.segment-header h2 {
    color: #333;
    margin: 0;
    font-size: 20px; /* Slightly smaller for the floating box */
    font-weight: 600; /* Make it a bit bolder */
    white-space: nowrap; /* Prevent text wrapping in the floating box */
    /* Removed: font-weight: 600; white-space: nowrap/normal (for rotation); transform; transform-origin; text-align */
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
    overflow-y: auto;
    gap: 15px;
    padding-top: 10px;
}

.subsegment-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.subsegment-header {
    margin-bottom: 15px;
}

.subsegment-header h3 {
    color: #444;
    margin: 0;
    font-size: 1.2em;
}

.category-section {
    margin: 0;
    padding: 5px 10px 10px 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    flex: 0 1 auto;
    border: 1px solid #eee;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    text-decoration: underline;
}

.category-header h3 {
    color: #555;
    margin: 0;
    font-size: 16px;
}

.subsegment-name {
    color: #666;
    font-size: 0.9em;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 4px;
}

.organizations-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /*padding: 10px 0;*/
}

.organization-item {
    position: relative;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    /*
    overflow: hidden;
    width: 100px;
    height: 100px;
    display: flex; 
    align-items: center;
    justify-content: center;
    */
}

.organization-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Pro Account Styling - Altın Hale */
.organization-item.pro-account {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(45deg, #FFD700, #FFA500, #FFD700) border-box;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    position: relative;
}

.organization-item.pro-account:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
}

.organization-item.pro-account .org-logo,
.organization-item.pro-account .org-name-box {
    border-radius: 4px;
}
/* Pro Account Styling - Altın Hale */

/* Pro Account Alternative Styling */
.organization-item.pro-account .org-name-box {
    background: linear-gradient(135deg, #FFF9E6, #FFFBF0);
    border: 1px solid #FFD700 !important;
}

.organization-item.special-border-gradient {
    position: relative;
    z-index: 1;
}

.organization-item.special-border-gradient::before {
    content: '';
    position: absolute;
    z-index: -1;
    /* Arka plana gitsin */
    inset: -3px;
    /* Kenarlığın kalınlığı. -(border-width) olmalı */
    border-radius: inherit;
    /* Ana elemanın border-radius'unu alsın (8px olur) */

    /* @property destekleniyorsa bu daha iyi: */
    background: conic-gradient(from var(--gradient-angle),
            #ff00c1,
            #9a00ff,
            #0059ff,
            #00ffb3,
            #9aff00,
            #ffc700,
            #ff0000,
            #ff00c1
            /* Döngüyü tamamlamak için ilk renk */
        );
    animation: rotating-gradient-property 4s linear infinite;
}

.org-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.org-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
}

.org-name {
    font-size: 0.9em;
    color: #333;
    text-align: center;
    margin-top: 5px;
}

.org-name-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.8em;
    text-align: center;
    padding: 5px;
    word-break: break-word;
}

.pro-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: white;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    border: 2px solid white;
    z-index: 10;
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 2px 12px rgba(255, 215, 0, 0.8);
    }

    100% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    }
}

.error-message {
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    color: #d32f2f;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
    margin-top: 70px;
    /* Ensure it's below top-bar */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-view {
        padding: 10px;
    }

    .organizations-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .org-logo {
        width: 60px;
        height: 60px;
    }

    .org-name-box {
        width: 60px;
        height: 60px;
    }

}

@keyframes rotating-gradient-border {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* @property (Houdini API) ile daha pürüzsüz gradyan animasyonu (daha modern tarayıcılar) */
@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotating-gradient-property {
    0% {
        --gradient-angle: 0deg;
    }

    100% {
        --gradient-angle: 360deg;
    }
}

/* Organization Search in Filter */
.org-search-group {
    position: relative;
    min-width: 250px;
    max-width: 350px;
    flex: 1 1 250px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    align-self: flex-end;
    margin-bottom: 0;
}

.org-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.org-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.08);
}

.org-search-results {
    position: absolute;
    top: 110%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1001;
    max-height: 260px;
    overflow-y: auto;
    min-width: 100%;
}

.org-search-result-item {
    padding: 3px 12px;
    margin: 5px 0 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: #333;
    border-left: 3px solid #4CAF50;
    background: none;
}

.org-search-result-item:hover {
    background-color: #f5f5f5;
    color: #333;
}

.org-search-result-item:last-child {
    border-bottom: none;
}

/* Highlight effect for found organization */
.organization-item.org-highlight {
    animation: org-highlight-glow 2s ease;
    box-shadow: 0 0 0 4px #007bff55, 0 0 16px #007bff44;
    border-color: #007bff !important;
    z-index: 2;
}

@keyframes org-highlight-glow {
    0% { box-shadow: 0 0 0 0 #007bff00; border-color: #007bff; }
    20% { box-shadow: 0 0 0 8px #007bff44; border-color: #007bff; }
    80% { box-shadow: 0 0 0 4px #007bff55; border-color: #007bff; }
    100% { box-shadow: 0 0 0 0 #007bff00; border-color: inherit; }
}

.org-search-results:empty {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    min-height: 0;
    padding: 0;
}

/* Ensure all filter-groups are aligned at the bottom */
.filter-content .filter-group {
    align-self: flex-end;
    margin-bottom: 0;
}

.print-table-btn {
    padding: 10px 16px;
    font-size: 15px;
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.2s, border 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
} 

body.table-view-active #main-content {
    overflow-y: auto !important; /* Show scrollbar for table view on the main content area */
}