/**
 * Banner Modülü - Stylesheet (Tema Uyumlu)
 * Primary Color: #00c9b7 (Turkuaz)
 */

/* ====================================
   Container & Layout
   ==================================== */
.banner-top-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .banner-top-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 0;
    }
}

/* ====================================
   Banner Slot
   ==================================== */
.banner-slot {
    position: relative;
    width: 100%;
    min-height: 90px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 201, 183, 0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 201, 183, 0.1);
}

.banner-slot:hover {
    box-shadow: 0 4px 20px rgba(0, 201, 183, 0.2);
    transform: translateY(-2px);
    border-color: rgba(0, 201, 183, 0.3);
}

/* ====================================
   Banner Content (Aktif Banner)
   ==================================== */
.banner-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-content a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.banner-content img {
    width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: cover;
    display: block;
}

/* ====================================
   Placeholder (Boş Slot)
   ==================================== */
.banner-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    padding: 20px;
    background: linear-gradient(135deg, #00c9b7 0%, #00a99a 100%);
    color: white;
    text-align: center;
}

.banner-placeholder-content {
    width: 100%;
}

.banner-placeholder svg {
    opacity: 0.9;
    margin-bottom: 10px;
}

.banner-placeholder h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.banner-placeholder p {
    margin: 0 0 15px 0;
    font-size: 14px;
    opacity: 0.95;
}

/* ====================================
   Rent Button
   ==================================== */
.banner-rent-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.banner-rent-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    transform: scale(1.05);
}

.banner-rent-btn svg {
    width: 16px;
    height: 16px;
}

/* ====================================
   Modal
   ==================================== */
.banner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050; /* Bootstrap modal seviyesi, SweetAlert2 (10000) altında */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.banner-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.banner-modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================
   Modal Header
   ==================================== */
.banner-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #00c9b7 0%, #00a99a 100%);
    color: white;
}

.banner-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.banner-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.banner-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ====================================
   Modal Body & Form
   ==================================== */
.banner-modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00c9b7;
    box-shadow: 0 0 0 3px rgba(0, 201, 183, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* ====================================
   Banner Preview
   ==================================== */
.banner-preview {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid rgba(0, 201, 183, 0.2);
}

.banner-preview label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.banner-preview-frame {
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.banner-preview-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* ====================================
   Form Actions
   ==================================== */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #00c9b7 0%, #00a99a 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 201, 183, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

/* ====================================
   Loading State
   ==================================== */
.banner-slot.loading {
    pointer-events: none;
    opacity: 0.7;
}

.banner-slot.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(0, 201, 183, 0.3);
    border-top-color: #00c9b7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================================
   Responsive
   ==================================== */
@media (max-width: 767px) {
    .banner-top-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }

    .banner-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .banner-modal-header h2 {
        font-size: 20px;
    }
}

/* ====================================
   Accessibility
   ==================================== */
.banner-slot:focus-visible,
.banner-rent-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 3px solid #00c9b7;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====================================
   SweetAlert2 Custom Theme
   ==================================== */
.swal2-styled.swal2-confirm {
    background-color: #00c9b7 !important;
}

.swal2-styled.swal2-confirm:hover {
    background-color: #00a99a !important;
}

/* ====================================
   Error Messages
   ==================================== */
.banner-error {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    color: #856404;
}

.banner-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    color: #155724;
}
