/* =====================================================
   SLIDER MANAGEMENT - RESPONSIVE STYLING
   ===================================================== */

/* Desktop Styles (1024px and above) */
@media (min-width: 1024px) {
    .sliders-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
        margin-top: 30px;
    }

    .slider-card {
        max-width: 100%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .slider-card:hover {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    }

    .modal-content {
        max-width: 650px;
        width: 90%;
    }
}

/* Tablet Styles (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sliders-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
        margin-top: 25px;
    }

    .slider-card {
        border-radius: 8px;
        overflow: hidden;
    }

    .slider-image {
        height: 180px;
    }

    .slider-headline {
        font-size: 16px;
    }

    .slider-description {
        font-size: 12px;
        line-height: 1.5;
    }

    .slider-actions {
        flex-direction: row;
        gap: 8px;
    }

    .slider-actions button {
        padding: 8px;
        font-size: 11px;
    }

    .modal-content {
        max-width: 550px;
        padding: 30px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 13px;
    }
}

/* Mobile Landscape (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .sliders-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
        margin-top: 20px;
    }

    .slider-card {
        flex-direction: row;
        height: 200px;
    }

    .slider-image {
        width: 150px;
        height: 150px;
        min-width: 150px;
    }

    .slider-info {
        padding: 12px;
        justify-content: space-between;
    }

    .slider-headline {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .slider-subheadline {
        font-size: 10px;
    }

    .slider-description {
        display: none;
    }

    .slider-actions {
        width: 100%;
    }

    .slider-actions button {
        padding: 6px;
        font-size: 10px;
    }

    .modal-content {
        max-width: 95%;
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 8px;
        font-size: 12px;
    }

    .image-upload-wrapper {
        padding: 15px;
    }

    .image-upload-wrapper::after {
        font-size: 12px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions button {
        padding: 10px;
        font-size: 12px;
    }
}

/* Mobile Portrait (below 576px) */
@media (max-width: 575px) {
    .sliders-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 15px;
    }

    .slider-card {
        flex-direction: row;
        height: 180px;
    }

    .slider-image {
        width: 120px;
        height: 120px;
        min-width: 120px;
    }

    .slider-info {
        padding: 10px;
        justify-content: center;
    }

    .slider-subheadline {
        display: none;
    }

    .slider-headline {
        font-size: 13px;
        margin-bottom: 4px;
        line-height: 1.3;
    }

    .slider-description {
        display: none;
    }

    .slider-status {
        padding: 2px 8px;
        font-size: 10px;
        margin-bottom: 8px;
    }

    .slider-actions {
        width: 100%;
        flex-direction: column;
        gap: 6px;
        border: none;
        padding: 0;
        margin: 0;
    }

    .slider-actions button {
        padding: 6px;
        font-size: 9px;
        gap: 4px;
    }

    .slider-actions i {
        display: none;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        padding: 15px;
        border-radius: 8px;
    }

    .modal h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .close-modal {
        right: 10px;
        top: 10px;
        font-size: 24px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-row .full-width {
        grid-column: 1;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 8px;
        font-size: 12px;
        border-radius: 4px;
    }

    textarea {
        resize: vertical;
        max-height: 120px;
    }

    .image-upload-wrapper {
        padding: 15px;
        border-radius: 6px;
    }

    .image-upload-wrapper::after {
        font-size: 11px;
        content: '📁 Upload Image';
    }

    .image-preview-container {
        flex-direction: column;
        align-items: center;
    }

    .image-preview-container img {
        max-width: 100%;
        max-height: 150px;
    }

    .btn-remove-image {
        width: 100%;
        padding: 8px;
        font-size: 11px;
    }

    .form-actions {
        flex-direction: column;
        margin-top: 15px;
        padding-top: 15px;
        gap: 10px;
    }

    .form-actions button {
        width: 100%;
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* Ultra-small devices (below 360px) */
@media (max-width: 359px) {
    .slider-card {
        height: auto;
        flex-direction: column;
    }

    .slider-image {
        width: 100%;
        height: 100px;
    }

    .modal-content {
        padding: 12px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .modal h2 {
        font-size: 16px;
    }
}

/* High DPI Devices (Retina) */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .slider-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .slider-card:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

    .modal-content {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }
}

/* Landscape Orientation */
@media (max-height: 500px) {
    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group input,
    .form-group textarea {
        padding: 6px;
    }
}

/* Touch Devices Optimization */
@media (hover: none) and (pointer: coarse) {
    .slider-actions button {
        min-height: 44px;
        min-width: 44px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .modal {
        padding: 0;
    }

    .modal-content {
        border-radius: 0;
    }
}

/* Print Styles */
@media print {
    .slider-actions {
        display: none;
    }

    .modal,
    .overlay {
        display: none !important;
    }

    .sliders-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .slider-card {
        background: #1e1e1e;
        color: #f0f0f0;
    }

    .slider-headline {
        color: #f0f0f0;
    }

    .slider-description {
        color: #b0b0b0;
    }

    .modal-content {
        background: #1e1e1e;
        color: #f0f0f0;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        background: #2a2a2a;
        color: #f0f0f0;
        border-color: #404040;
    }
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    .slider-card,
    .slider-actions button,
    .modal-content {
        transition: none !important;
    }
}
