* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #e74c3c;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

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

header {
    background: var(--primary-gradient);
    color: white;
    padding: 40px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
}

header > * {
    position: relative;
    z-index: 1;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform var(--transition-smooth);
}

.logo:hover {
    transform: scale(1.05);
}

header h1 {
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
}

#auth-status {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#auth-info {
    margin-right: 10px;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-smooth);
    border: 1px solid transparent;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .form-row input,
[dir="rtl"] .form-row select,
[dir="rtl"] .form-row textarea,
[dir="rtl"] .search-form input,
[dir="rtl"] .search-form select {
    text-align: right;
}

[dir="rtl"] .studio-info-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .checkbox-grid label,
[dir="rtl"] #studio_types_container label,
[dir="rtl"] #edit-studio-types-container label {
    flex-direction: row-reverse;
}

[dir="rtl"] .checkbox-grid input[type="checkbox"],
[dir="rtl"] #studio_types_container input[type="checkbox"],
[dir="rtl"] #edit-studio-types-container input[type="checkbox"] {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .map-info,
[dir="rtl"] .form-section-title {
    border-left: none;
    border-right: 5px solid var(--primary-color);
}

[dir="rtl"] .studio-card::before {
    left: auto;
    right: 0;
}

button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.add-studio-btn {
    background: var(--success-color);
}

.add-studio-btn:hover {
    background: #38a169;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    transition: all var(--transition-smooth);
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

main {
    padding: 40px 30px;
}

section {
    margin-bottom: 50px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

section h2 {
    color: var(--text-dark);
    margin-bottom: 24px;
    padding-bottom: 12px;
    font-size: 1.75em;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width var(--transition-smooth);
}

section h2:hover::after {
    width: 100%;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.search-form input,
.search-form select {
    padding: 12px 16px;
    border: 2px solid transparent;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    transition: all var(--transition-smooth);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row.full-width {
    grid-template-columns: 1fr;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all var(--transition-smooth);
    background: white;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
    width: 100%;
    line-height: 1.5;
}

#studio-form button {
    margin-top: 10px;
    width: 100%;
}

.studio-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.studio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform var(--transition-smooth);
}

.studio-card:hover::before {
    transform: scaleY(1);
}

.studio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.studio-card h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.5em;
    font-weight: 700;
    transition: color var(--transition-fast);
}

.studio-card:hover h3 {
    color: var(--secondary-color);
}

.studio-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.studio-info-item {
    display: flex;
    gap: 5px;
}

.studio-info-item strong {
    color: #555;
}

.studio-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.edit-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

.delete-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.influence-badge {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.influence-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gender-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.gender-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gender-both {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.gender-men {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.gender-women {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    color: white;
}

/* Language switcher for login page */
.language-switcher-top {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 5px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .language-switcher-top {
    right: auto;
    left: 20px;
}

.lang-btn-simple {
    color: var(--text-dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
}

.lang-btn-simple:hover {
    background: var(--primary-gradient);
    color: white;
}

.lang-btn-simple.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
}

.login-container h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.login-container button {
    padding: 12px;
    font-size: 16px;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
}

.info-text {
    text-align: center;
    color: #666;
    margin-top: 15px;
    font-size: 14px;
}

.login-container a {
    text-align: center;
    color: #667eea;
    text-decoration: none;
    margin-top: 15px;
    display: block;
}

.login-container a:hover {
    text-decoration: underline;
}

.no-studios {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-light);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    font-size: 1.1em;
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error messages with animations */
.success-message,
.error-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideInDown 0.4s ease;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

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

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 5px solid #28a745;
    color: #155724;
}

.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 5px solid #dc3545;
    color: #721c24;
}

/* Map Styles */
#map {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

#map:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.map-section {
    margin-bottom: 50px;
}

.map-info {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.map-info:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.map-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.map-popup h3 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 1.1em;
}

.map-popup p {
    margin: 5px 0;
    font-size: 0.9em;
}

.view-map-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.3s;
}

.view-map-btn:hover {
    background: #2980b9;
}

.map-hint {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
}

.map-hint p {
    margin: 0;
    color: #1976d2;
    font-size: 14px;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .studio-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .container {
        border-radius: 12px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        padding: 24px 16px;
        text-align: center;
    }
    
    .header-brand {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo {
        height: 45px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    #auth-status {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    
    #auth-status button,
    #auth-status a {
        flex: 1;
        min-width: 120px;
    }
    
    main {
        padding: 16px;
    }
    
    section h2 {
        font-size: 1.4em;
        margin-bottom: 16px;
    }
    
    .search-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .studio-card {
        margin-bottom: 16px;
    }
    
    .studio-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .studio-info-item {
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .studio-info-item:last-child {
        border-bottom: none;
    }
    
    .studio-info-item strong {
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #888;
    }
    
    .studio-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .studio-actions button {
        flex: 1;
        padding: 12px;
        font-size: 13px;
    }
    
    button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .login-container {
        margin: 50px auto;
        padding: 24px;
        max-width: 90%;
    }
    
    /* Badges mobile optimization */
    .influence-badge,
    .gender-badge {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    /* Map responsive */
    #map {
        height: 350px;
        border-radius: 8px;
    }
    
    .view-map-btn {
        margin-left: 0;
        margin-top: 8px;
        display: block;
        width: 100%;
    }
    
    /* Language switcher mobile */
    .language-switcher-top {
        top: 12px;
        right: 12px;
        padding: 6px;
    }
    
    [dir="rtl"] .language-switcher-top {
        right: auto;
        left: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    header {
        padding: 20px 12px;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    #auth-status {
        flex-direction: column;
        gap: 8px;
    }
    
    #auth-status button,
    #auth-status a {
        width: 100%;
    }
    
    main {
        padding: 12px;
    }
    
    section h2 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .studio-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .studio-card h3 {
        font-size: 1.15em;
        margin-bottom: 12px;
    }
    
    .studio-info {
        gap: 8px;
    }
    
    .studio-info-item {
        padding: 6px 0;
        font-size: 14px;
    }
    
    .studio-info-item strong {
        font-size: 11px;
    }
    
    .studio-actions {
        margin-top: 12px;
        gap: 6px;
    }
    
    .studio-actions button {
        padding: 10px;
        font-size: 12px;
    }
    
    button {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .login-container {
        margin: 20px auto;
        padding: 20px;
        max-width: 95%;
    }
    
    .login-container h1 {
        font-size: 1.4em;
    }
    
    /* Badges extra small mobile */
    .influence-badge,
    .gender-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    /* Map mobile */
    #map {
        height: 280px;
    }
    
    /* Language switcher compact */
    .language-switcher-top {
        top: 8px;
        right: 8px;
        padding: 4px;
        gap: 3px;
    }
    
    [dir="rtl"] .language-switcher-top {
        right: auto;
        left: 8px;
    }
    
    .lang-btn-simple {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-form {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .studio-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Desktop */
@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        max-width: 1000px;
    }
}

/* Improve touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
    button,
    .nav-link,
    input,
    select {
        min-height: 44px;
    }
    
    .studio-actions button {
        padding: 14px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
    .instructors-list-container {
        margin-top: 8px;
    }
    
    .add-instructor-input {
        flex-direction: column;
        gap: 8px;
    }
    
    .add-instructor-input input {
        width: 100%;
    }
    
    .add-instructor-btn {
        width: 100%;
        justify-content: center;
        max-width: none;
    }
    
    .instructors-list {
        gap: 8px;
        padding: 12px;
        min-height: 50px;
    }
    
    .instructor-item {
        font-size: 13px;
        padding: 6px 10px 6px 14px;
    }
    
    .instructor-item button {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
    
    .form-section-title {
        font-size: 16px;
        padding: 12px 16px;
    }
    
    .collapsible-header {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-content {
        margin: 20px auto;
        padding: 24px;
        width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .instructors-list {
        padding: 10px;
        gap: 6px;
    }
    
    .instructor-item {
        font-size: 12px;
        padding: 5px 8px 5px 12px;
    }
    
    .instructor-item button {
        width: 16px;
        height: 16px;
        font-size: 11px;
    }
    
    .form-section-title {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .collapsible-header {
        padding: 12px;
        font-size: 14px;
    }
    
    .modal-content {
        margin: 10px auto;
        padding: 20px;
    }
}

/* Collapsible sections */
.collapsible-section {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.collapsible-section:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.collapsible-header {
    width: 100%;
    padding: 18px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.collapsible-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.5s ease;
}

.collapsible-header:hover::before {
    left: 100%;
}

.collapsible-header:hover {
    padding-left: 28px;
}

.toggle-icon {
    font-size: 14px;
    transition: transform var(--transition-smooth);
    display: inline-block;
}

.collapsible-header.active .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition-smooth);
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
}

.collapsible-content.expanded {
    max-height: 800px;
    max-height: 60vh;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* Checkbox styling for studio types */
.checkbox-grid label,
#studio_types_container label,
#edit-studio-types-container label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    transition: all var(--transition-smooth);
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.checkbox-grid label::before,
#studio_types_container label::before,
#edit-studio-types-container label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transition: width var(--transition-smooth);
    z-index: 0;
}

.checkbox-grid label:hover::before,
#studio_types_container label:hover::before,
#edit-studio-types-container label:hover::before {
    width: 100%;
}

.checkbox-grid label:hover,
#studio_types_container label:hover,
#edit-studio-types-container label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.checkbox-grid label > *,
#studio_types_container label > *,
#edit-studio-types-container label > * {
    position: relative;
    z-index: 1;
}

.checkbox-grid input[type="checkbox"],
#studio_types_container input[type="checkbox"],
#edit-studio-types-container input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.checkbox-grid input[type="checkbox"]:checked + *,
#studio_types_container input[type="checkbox"]:checked,
#edit-studio-types-container input[type="checkbox"]:checked {
    font-weight: 700;
}

/* Form section titles */
.form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 28px 0 16px 0;
    padding: 14px 20px;
    background: linear-gradient(to right, #f0f4ff, #fafbff);
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.form-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary-gradient);
}

.form-section-title:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 40px;
    border: none;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.close {
    color: var(--text-light);
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-smooth);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.close:hover,
.close:focus {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
    transform: rotate(90deg);
}

.modal-content h2 {
    margin-bottom: 24px;
    color: var(--primary-color);
    font-size: 2em;
    font-weight: 700;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primary-gradient);
}

.modal-content form {
    margin-top: 24px;
}

/* Instructors list styling */
.instructors-list-container {
    width: 100%;
}

.add-instructor-input {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    max-width: 500px;
}

.add-instructor-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all var(--transition-smooth);
    background: white;
    min-width: 0;
}

.add-instructor-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.add-instructor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 100px;
    max-width: 140px;
}

.add-instructor-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.add-instructor-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

.add-instructor-btn span:first-child {
    font-size: 14px;
    line-height: 1;
}

.instructors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    transition: all var(--transition-smooth);
}

.instructors-list:empty::after {
    content: '';
    display: none;
}

.instructor-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 12px 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all var(--transition-smooth);
    position: relative;
}

.instructor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.instructor-item span {
    letter-spacing: 0.2px;
}

.instructor-item button {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: all var(--transition-fast);
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.instructor-item button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.instructor-item button:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

.no-instructors {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-style: italic;
    width: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Instructor Cards */
.instructor-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.instructor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.instructor-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.instructor-info {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.instructor-info-item {
    display: flex;
    gap: 5px;
}

.instructor-info-item strong {
    color: #555;
}

.instructor-info p {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.6;
}

.instructor-info strong {
    color: #333;
    font-weight: 600;
}

.instructor-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.instructor-section h4 {
    margin: 0 0 0.5rem 0;
    color: #555;
    font-size: 1rem;
}

.instructor-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.instructor-info a {
    color: #4CAF50;
    text-decoration: none;
}

.instructor-info a:hover {
    text-decoration: underline;
}

.view-on-map-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.view-on-map-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Instructor Popup */
.instructor-popup {
    min-width: 200px;
}

.instructor-popup h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #4CAF50;
    font-size: 1.1rem;
}

.instructor-popup p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.instructor-popup strong {
    color: #333;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}
