/* Gatupratare Media Manager - Adminpanel Style */
/* admin/gatupratare-test/gatupratare-styles.css */

/* Gatupratare Content Container - Match admin.php style */
.gatupratare-content {
    color: #ffffff;
}

/* Ensure dashboard-sections padding is respected */
.dashboard-sections {
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Ensure section has proper spacing - Match admin.php style */
.section {
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    /* Ensure section respects dashboard-sections padding */
    width: 100%;
    max-width: 100%;
    /* Ensure section doesn't extend beyond dashboard-sections padding */
    margin-left: 0;
    margin-right: 0;
}

/* Ensure media groups row respects section padding - match original structure */
.section > .media-groups-row {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Ensure it respects parent padding like original .media-group does */
    margin-left: 0;
    margin-right: 0;
    /* Match original .media-group margin behavior */
    margin-top: 12px;
    margin-bottom: 12px;
}

/* KOMPAKTA BUTIKSKORT - ULTRA KOMPAKT DESIGN */
.section-header-compact {
    margin-bottom: 20px;
}

.section-header-compact h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #ffffff;
    /* Ensure h2 doesn't cause overflow */
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.stores-compact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    justify-content: space-between;
}

.store-compact-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    width: auto;
    min-width: fit-content;
    flex-shrink: 0;
}

.store-compact-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.store-compact-card.has-media {
    border-left: 3px solid #4caf50;
}

.store-compact-card.no-media {
    border-left: 3px solid #f44336;
}

.store-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.store-name-compact {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.store-name-compact i {
    color: #ffffff;
    font-size: 0.8em;
}

.store-code-compact {
    font-size: 0.7em;
    color: #cccccc;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 4px;
    border-radius: 2px;
}

.store-media-stats-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.media-stat-compact {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75em;
    color: #cccccc;
    font-weight: 600;
}

.media-stat-compact.images i {
    color: #2196f3;
    font-size: 0.85em;
}

.media-stat-compact.videos i {
    color: #ff9800;
    font-size: 0.85em;
}

.status-badge {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    flex-shrink: 0;
}

.status-active-compact {
    background: rgba(76, 175, 80, 0.2);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-inactive-compact {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

/* UPLOAD KNAPP I HEADER */
.section-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    /* Ensure it respects section padding */
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.upload-open-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    /* Ensure button doesn't cause overflow */
    white-space: nowrap;
    min-width: 0;
    text-decoration: none;
}

.upload-open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.upload-open-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-open-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Hover-effekt för knappar med annan bakgrundsfärg */
.upload-open-btn[style*="background: #6c757d"]:hover,
.upload-open-btn[style*="background:#6c757d"]:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.upload-open-btn[style*="background: #dc3545"]:hover,
.upload-open-btn[style*="background:#dc3545"]:hover,
.upload-open-btn[style*="background: rgb(220, 53, 69)"]:hover,
.upload-open-btn[style*="background:rgb(220, 53, 69)"]:hover {
    background: linear-gradient(135deg, #ff4757, #ff3742) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

.upload-open-btn i {
    font-size: 1em;
}

/* UPLOAD MODAL */
.upload-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.upload-modal.show {
    display: flex;
}

.upload-modal-content {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.upload-modal-header {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.upload-modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

.upload-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* STORES MODAL */
.stores-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.stores-modal.show {
    display: flex;
}

.stores-modal-content {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.stores-modal-header {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stores-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.stores-modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stores-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

.stores-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.stores-list-container {
    margin-bottom: 20px;
}

.stores-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stores-list-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.stores-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.store-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.store-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.store-item.enabled {
    border-left: 4px solid #28a745;
}

.store-item.disabled {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.store-item-info {
    flex: 1;
}

.store-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.store-item-name strong {
    font-size: 1em;
    color: #ffffff;
}

.store-item-key {
    font-size: 0.85em;
    color: #cccccc;
    font-family: monospace;
}

.store-item-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-item-status {
    font-size: 0.85em;
    padding: 3px 8px;
    border-radius: 4px;
}

.store-item-status.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.store-item-status.status-inactive {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.store-item-actions {
    display: flex;
    gap: 8px;
}

/* ADMIN BUTTON - Match btn-secondary style from admin.php */
.admin-button {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 0;
    text-decoration: none;
}

.admin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.admin-button i {
    font-size: 1em;
}

.admin-button.small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.admin-button.danger {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    border: none;
}

.admin-button.danger:hover {
    background: linear-gradient(135deg, #ff5f6f, #ff4757);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

.admin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.no-stores {
    text-align: center;
    padding: 30px;
    color: #cccccc;
    font-style: italic;
}

.store-form-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.store-form-container h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #ffffff;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #ffffff;
}

.form-group input[type="text"],
.form-group input[type="checkbox"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.95em;
    color: #ffffff;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #cccccc;
    font-size: 0.85em;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .media-groups-row {
        flex-direction: column;
    }
}

/* FÖRHANDSVISNING - ADMINPANEL STIL */
.gatupratare-preview-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    overflow-x: auto;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gatupratare-preview-container::-webkit-scrollbar {
    height: 8px;
}

.gatupratare-preview-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.gatupratare-preview-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.gatupratare-preview-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gatupratare-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    min-width: 130px;
    max-width: 150px;
    min-height: 250px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    justify-content: space-between; /* Fördelar utrymme vertikalt */
}

/* Liggande kort - rotera hela kortet 90 grader */
.gatupratare-preview-item.preview-item-lying {
    min-width: 160px;
    max-width: 180px;
    min-height: 200px;
    justify-content: space-between; /* Fördelar utrymme vertikalt */
}

/* Centrera slideshow vertikalt i liggande kort */
.gatupratare-preview-item.preview-item-lying .preview-slideshow {
    margin: auto 0 !important;
}

.gatupratare-preview-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.preview-label {
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 0;
    text-align: center;
    font-size: 0.9em;
    flex-shrink: 0;
    /* Positionera från toppen */
    align-self: flex-start;
    width: 100%;
}

.file-count {
    display: block;
    font-size: 0.75em;
    color: #cccccc;
    font-weight: normal;
    margin-top: 3px;
}

.preview-slideshow {
    width: 90px !important;
    height: 160px !important;
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin: 8px auto; /* Centrera horisontellt */
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Tillåt att slideshow tar upp tillgängligt utrymme i mitten */
    flex: 0 0 auto;
}

/* Liggande orientering - byt dimensioner på slideshow */
.preview-slideshow.preview-lying {
    width: 160px !important;
    height: 90px !important;
}

.preview-slideshow .media-wrapper {
    width: 160px;
    height: 90px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.3s ease;
}

.preview-slideshow .media-wrapper.visible {
    opacity: 1;
}

/* Liggande orientering - rotera 90 grader medurs från stående position */
.preview-slideshow.preview-lying .media-wrapper {
    transform: translate(-50%, -50%) rotate(0deg);
}

.preview-slideshow .media-wrapper img,
.preview-slideshow .media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cccccc;
    font-size: 0.8em;
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
    /* Tillåt att placeholder tar upp tillgängligt utrymme i mitten */
    flex: 0 0 auto;
}

.preview-status {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.7em;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
    /* Positionera från botten */
    align-self: flex-end;
    width: 100%;
}

.preview-status .status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
}

.preview-status .status-active i {
    font-size: 0.85em;
}

.preview-status .status-active i.fa-images {
    color: #64b5f6;
}

.preview-status .status-active i.fa-video {
    color: #ffb74d;
}

.preview-status .status-empty {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.preview-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* UPLOAD-SEKTION - ADMINPANEL STIL */
.upload-zone {
    border: 3px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 20px 0;
}

.upload-zone:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.upload-zone.dragover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    font-size: 3em;
    color: #ffffff;
    margin-bottom: 10px;
}

.upload-zone p {
    color: #ffffff;
    margin: 5px 0;
}

.upload-zone .file-info {
    color: #cccccc;
    font-size: 0.9em;
}

.upload-zone .no-limit-info {
    color: #4caf50;
    font-weight: bold;
    font-size: 0.9em;
}

.file-input {
    display: none;
}

/* STATUS MEDDELANDEN */
.status {
    margin: 15px 0;
    padding: 12px;
    border-radius: 6px;
    display: none;
    border: 1px solid transparent;
}

.status.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #4caf50;
}

.status.error {
    background: #ffebee;
    color: #c62828;
    border-color: #f44336;
}

.status.warning {
    background: #fff8e1;
    color: #f57c00;
    border-color: #ffb74d;
}

.status.info {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #2196f3;
}

/* VALDA FILER */
.selected-files {
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-weight: 600;
    color: #ffffff;
}

.file-item-details {
    font-size: 0.8em;
    color: #cccccc;
    margin-top: 3px;
}

.remove-file-btn {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.remove-file-btn:hover {
    background: linear-gradient(135deg, #ff5f6f, #ff4757);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3);
}

/* MEDIAGRUPPER - KOMPAKT SIDO VID SIDO */
.media-groups-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    /* Use 100% width but ensure it respects parent padding - match original .media-group behavior */
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
    /* Ensure content respects section padding - prevent overflow */
    overflow-x: auto;
    overflow-y: visible;
    /* Ensure it doesn't extend beyond section padding */
    min-width: 0;
    /* Match original structure - no negative margins or positioning that breaks padding */
    position: relative;
}

.media-group-compact {
    flex: 1;
    min-width: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.group-header-compact {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 6px 10px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.group-header-compact h3 {
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* MEDIAGRUPPER - ADMINPANEL STIL */
.media-group {
    margin: 25px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-group.media-group-compact {
    /* Match original .media-group structure - respect section padding */
    margin: 0 !important;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

.group-header {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 15px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.group-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-header::after {
    content: '↕ Scroll';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 3px 6px;
    border-radius: 10px;
    font-weight: normal;
}

/* MEDIA TABELLER - KOMPAKT */
.table-responsive-compact {
    max-height: 400px;
    width: 100%;
    overflow-y: auto;
    overflow-x: auto;
    box-sizing: border-box;
    /* Ensure it doesn't extend beyond parent */
    min-width: 0;
}

.media-table-compact {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.65em;
    display: table;
    box-sizing: border-box;
    /* Ensure table respects container width */
    min-width: 0;
}

.media-table-compact thead {
    display: table-header-group;
}

.media-table-compact tbody {
    display: table-row-group;
}

.media-table-compact thead tr,
.media-table-compact tbody tr {
    display: table-row;
}

.media-table-compact th,
.media-table-compact td {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
    padding: 3px 4px;
    display: table-cell;
}

.file-col-compact {
    width: 1% !important;
    white-space: nowrap;
    text-align: left;
}

.store-col-compact {
    width: auto !important;
    min-width: 50px;
    font-size: 0.7em;
}

.media-table-compact th {
    background: rgba(10, 10, 10, 0.98);
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    line-height: 1.1;
    padding: 4px 3px;
    font-size: 0.7em;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.media-table-compact td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    color: #cccccc;
}

.media-table-compact tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.media-table-compact tbody tr:hover td {
    background: rgba(255, 255, 255, 0.08);
}

/* MEDIA TABELLER */
.media-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    display: block;
    table-layout: fixed;
    font-size: 0.85em;
}

.media-table thead {
    display: block;
    width: 100%;
}

.media-table tbody {
    display: block;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.media-table thead tr,
.media-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-spacing: 0;
}

.media-table th,
.media-table td {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
    padding: 8px;
}

.media-table th:nth-child(1),
.media-table td:nth-child(1) {
    width: 280px !important;
    text-align: left;
}

.media-table th:not(:first-child),
.media-table td:not(:first-child) {
    width: calc((100% - 280px) / 6) !important;
    min-width: 90px;
}

.media-table th {
    background: rgba(10, 10, 10, 0.98);
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    line-height: 1.2;
    padding: 10px 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.media-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    color: #cccccc;
}

.media-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

.media-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.08);
}

/* FILFÖRHANDSVISNING - KOMPAKT */
.file-preview-compact {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 2px;
    width: fit-content;
}

.image-preview-wrapper-compact,
.video-preview-wrapper-compact {
    display: flex;
    align-items: center;
    gap: 3px;
}

.image-container-compact,
.video-container-compact {
    width: 35px;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container-compact img,
.video-container-compact video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 3px;
}

.media-btn-compact {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border: none;
    border-radius: 3px;
    width: 18px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #000000;
    font-size: 7px;
    font-weight: bold;
    padding: 0;
}

.media-btn-compact:hover {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.2);
}

.media-btn-compact.play-btn::before {
    content: '▶';
    margin-left: 1px;
}

.media-btn-compact.view-btn::before {
    content: '👁';
    font-size: 6px;
}

.file-info-compact {
    text-align: left;
    flex-shrink: 0;
}

.file-name-compact {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.7em;
    line-height: 1.2;
    margin-bottom: 1px;
    white-space: nowrap;
}

.file-size-compact {
    font-size: 0.65em;
    color: #cccccc;
}

.checkbox-cell-compact {
    padding: 4px;
    text-align: center;
}

.store-checkbox-compact {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #000000;
}

.store-update-btn-compact {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #000000;
    border: none;
    padding: 2px 3px;
    border-radius: 4px;
    font-size: 0.45em;
    cursor: pointer;
    margin-top: 2px;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 25px;
}

.store-update-btn-compact:hover {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.2);
}

.placeholder-icon-compact {
    width: 40px;
    height: 22px;
    background: rgba(255, 71, 87, 0.3);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.6em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* FILFÖRHANDSVISNING */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 5px;
}

.image-preview-wrapper,
.video-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-container,
.video-container {
    width: 60px;
    height: 34px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img,
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.media-controls {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.media-btn {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #000000;
    font-size: 9px;
    font-weight: bold;
}

.media-btn:hover {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.2);
}

.media-btn.play-btn::before {
    content: '▶';
    margin-left: 1px;
}

.media-btn.view-btn::before {
    content: '👁';
    font-size: 8px;
}

.placeholder-icon {
    width: 60px;
    height: 34px;
    background: rgba(255, 71, 87, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.7em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-placeholder {
    background: rgba(255, 255, 255, 0.1);
}

.placeholder-icon-compact.image-placeholder {
    background: rgba(255, 255, 255, 0.1);
}

.file-info {
    flex: 1;
    text-align: left;
}

.file-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9em;
    line-height: 1.3;
    margin-bottom: 2px;
}

.file-size {
    font-size: 0.75em;
    color: #cccccc;
}

.checkbox-cell {
    padding: 8px;
}

.store-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #000000;
}

/* UPPDATERINGSKNAPPAR */
.store-update-btn {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #000000;
    border: none;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.6em;
    cursor: pointer;
    margin-top: 3px;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 60px;
}

.store-update-btn:hover {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.2);
}

.store-update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.store-update-btn-compact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* MEDIA MODAL - ADMINPANEL STIL */
.media-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.media-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.media-modal-content {
    position: relative;
    width: 420px;
    height: 750px;
    max-width: 90vw;
    max-height: 90vh;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.media-modal-header {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    min-height: 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.media-modal-title {
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    max-width: 70%;
    word-break: break-word;
}

.media-modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.media-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

.media-modal-media-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000;
    overflow: hidden;
    min-height: 500px;
    max-height: calc(100% - 180px); /* Reservera plats för header och footer */
}

.media-modal-media {
    width: 520px;
    height: 292px;
    max-width: none;
    transform: rotate(-90deg);
    transform-origin: center center;
    object-fit: cover;
    border: none;
    background: #000;
}

.media-modal-media.image {
    object-fit: contain;
}

.media-modal-actions {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 120px;
    max-height: 120px;
}

.modal-action-btn {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-action-btn:hover {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.modal-action-btn.delete-btn {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    border-color: transparent;
    color: #ffffff;
}

.modal-action-btn.delete-btn:hover {
    background: linear-gradient(135deg, #ff5f6f, #ff4757);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

.modal-action-btn.delete-btn.disabled {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.file-link-status {
    text-align: center;
    font-size: 0.8em;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 90%;
    word-wrap: break-word;
    border: 1px solid transparent;
}

.file-link-status.linked {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
    border-color: rgba(255, 71, 87, 0.3);
}

.file-link-status.not-linked {
    background: rgba(76, 175, 80, 0.2);
    color: #66bb6a;
    border-color: rgba(76, 175, 80, 0.3);
}

/* SCROLLBARS */
.selected-files::-webkit-scrollbar,
.media-table tbody::-webkit-scrollbar {
    width: 8px;
}

.selected-files::-webkit-scrollbar-track,
.media-table tbody::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.selected-files::-webkit-scrollbar-thumb,
.media-table tbody::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.selected-files::-webkit-scrollbar-thumb:hover,
.media-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* RESPONSIVT - ADMINPANEL STIL */
@media (max-width: 768px) {
    .stores-compact-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .store-compact-card {
        padding: 10px 12px;
        min-height: 55px;
    }
    
    .store-media-stats {
        gap: 10px;
        margin: 0 10px;
    }
    
    .gatupratare-preview-container {
        gap: 10px;
        justify-content: flex-start;
        padding: 10px;
    }
    
    .gatupratare-preview-item {
        min-width: 110px;
        max-width: 120px;
        padding: 10px;
    }
    
    .preview-slideshow {
        width: 75px !important;
        height: 134px !important;
    }
    
    .preview-slideshow .media-wrapper {
        width: 134px;
        height: 75px;
    }
    
    .media-table {
        font-size: 0.75em;
    }
    
    .media-table tbody {
        max-height: 400px;
    }
    
    .store-update-btn {
        font-size: 0.55em;
        padding: 3px 6px;
        min-width: 50px;
    }
    
    .image-container,
    .video-container,
    .placeholder-icon {
        width: 50px;
        height: 28px;
    }
    
    .media-btn {
        width: 20px;
        height: 14px;
        font-size: 8px;
    }
    
    .store-checkbox {
        width: 14px;
        height: 14px;
    }
    
    .media-modal-content {
        width: 340px;
        height: 600px;
    }
    
    .media-modal-media {
        width: 440px;
        height: 247px;
    }
    
    .media-modal-actions {
        min-height: 100px;
        max-height: 100px;
        padding: 10px 12px;
    }
    
    .preview-controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .stores-compact-grid {
        grid-template-columns: 1fr;
    }
    
    .store-compact-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        min-height: auto;
        padding: 12px;
    }
    
    .store-media-stats {
        margin: 0;
        align-self: stretch;
        justify-content: space-around;
    }
    
    .store-status {
        align-self: flex-end;
    }
    
    .media-modal-content {
        width: 300px;
        height: 520px;
        max-width: 95vw;
    }
    
    .media-modal-media {
        width: 380px;
        height: 214px;
    }
    
    .media-modal-actions {
        min-height: 90px;
        max-height: 90px;
        padding: 8px 10px;
    }
    
    .modal-action-btn {
        padding: 8px 15px;
        font-size: 0.8em;
        min-width: 100px;
    }
}

