/**
 * Report Modal System - Custom CSS
 * Replaces DaisyUI/Tailwind with semantic custom classes
 */

/* ========================================
   Modal Base Structure
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal[open] {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: -1;
}

.modal-backdrop button {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: default;
    opacity: 0;
}

/* ========================================
   Modal Box (Main Container)
   ======================================== */

.modal-box {
    position: relative;
    background: #ffffff !important;
    color: #1f2937 !important;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 24px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

/* Modal Box Sizes */
.modal-box.w-11\/12 {
    width: 91.666667%;
}

.modal-box.max-w-2xl {
    max-width: 672px;
}

.modal-box.max-w-md {
    max-width: 448px;
}

/* ========================================
   Modal Header & Close Button
   ======================================== */

.modal-box h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary, #1f2937);
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (min-width: 640px) {
    .modal-box h3 {
        font-size: 30px;
    }
}

.modal-box h3 i.text-warning {
    color: #f59e0b;
}

.modal-box h3 i.text-success {
    color: var(--secondary, #10b981);
}

/* Close Button (Top Right X) */
.modal-box form[method="dialog"] .btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-box form[method="dialog"] .btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1f2937;
}

/* ========================================
   Info Banner (Blue notification box)
   ======================================== */

.bg-info\/10 {
    background: rgba(59, 130, 246, 0.1) !important;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.bg-info\/10 p {
    margin: 0;
    line-height: 1.6;
    color: #1f2937;
}

.bg-info\/10 p:first-child {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: #1f2937;
}

@media (min-width: 640px) {
    .bg-info\/10 p:first-child {
        font-size: 18px;
    }
}

.bg-info\/10 p:last-child {
    font-size: 14px;
    opacity: 0.8;
}

@media (min-width: 640px) {
    .bg-info\/10 p:last-child {
        font-size: 16px;
    }
}

/* ========================================
   Form Elements
   ======================================== */

.modal-box form#reportForm {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-control {
    display: flex;
    flex-direction: column;
}

.form-control label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary, #1f2937);
}

@media (min-width: 640px) {
    .form-control label {
        font-size: 18px;
    }
}

.form-control label .text-red-500 {
    color: #ef4444;
}

/* Select Dropdown */
.form-control select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    background: #ffffff !important;
    color: #1f2937 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-control select:focus {
    outline: none;
    border-color: var(--primary, #764ba2);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.form-control select:hover {
    border-color: #9ca3af;
}

/* Textarea */
.form-control textarea,
.modal-box textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    background: #ffffff !important;
    color: #1f2937 !important;
    transition: all 0.2s ease;
}

.form-control textarea:focus,
.modal-box textarea:focus {
    outline: none;
    border-color: var(--primary, #764ba2);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.form-control textarea:hover,
.modal-box textarea:hover {
    border-color: #9ca3af;
}

/* Textarea heights */
textarea.h-40 {
    height: 160px;
}

@media (min-width: 640px) {
    textarea.h-48 {
        height: 192px;
    }
}

/* Character Counter */
.form-control + div,
.modal-box textarea + div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    padding: 0 4px;
}

.form-control + div span,
.modal-box textarea + div span {
    font-size: 12px;
    color: #6b7280;
}

.form-control + div span.font-mono,
.modal-box textarea + div span.font-mono {
    font-family: 'Courier New', monospace;
}

/* ========================================
   Alert Messages
   ======================================== */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.alert-success i {
    color: var(--secondary, #10b981);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.alert-error i {
    color: #ef4444;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Sizes */
.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 18px;
}

.btn-md {
    padding: 8px 16px;
    font-size: 16px;
}

/* Button Variants */
.btn-ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: #1f2937;
}

.btn-error {
    background: #ef4444;
    color: white;
}

.btn-error:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-circle {
    border-radius: 50%;
    padding: 8px;
    width: 32px;
    height: 32px;
}

.text-error {
    color: #ef4444;
}

.hover\:btn-error:hover {
    background: #ef4444;
    color: white;
}

/* ========================================
   Modal Actions (Footer Buttons)
   ======================================== */

.modal-action {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

@media (min-width: 640px) {
    .modal-action {
        gap: 16px;
    }
}

@media (max-width: 639px) {
    .modal-action {
        flex-direction: column-reverse;
    }
    
    .modal-action .btn {
        width: 100%;
    }
}

/* ========================================
   Loading States
   ======================================== */

.loading {
    display: inline-block;
    position: relative;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-spinner.loading-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

/* ========================================
   Success Screen
   ======================================== */

.modal-box.text-center {
    text-align: center;
}

.modal-box .py-8 {
    padding-top: 32px;
    padding-bottom: 32px;
}

.modal-box .text-6xl {
    font-size: 60px;
    line-height: 1;
}

.modal-box .text-6xl i {
    font-size: 60px;
}

.modal-box .mb-4 {
    margin-bottom: 16px;
}

.modal-box p.text-base-content\/80 {
    color: rgba(31, 41, 55, 0.8);
    font-size: 16px;
    line-height: 1.6;
}

/* ========================================
   Utility Classes
   ======================================== */

.absolute {
    position: absolute;
}

.right-2 {
    right: 8px;
}

.top-2 {
    top: 8px;
}

.block {
    display: block;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mt-6 {
    margin-top: 24px;
}

.space-y-6 > * + * {
    margin-top: 24px;
}

.w-full {
    width: 100%;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 639px) {
    .modal {
        padding: 8px;
    }
    
    .modal-box {
        padding: 20px;
        border-radius: 12px;
    }
    
    .modal-box h3 {
        font-size: 20px;
        margin-bottom: 20px;
        gap: 8px;
    }
    
    .bg-info\/10 {
        padding: 12px;
    }
    
    .form-control select,
    .form-control textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* ========================================
   Dark Mode Support - DISABLED
   Modal zawsze ma jasne tło i ciemny tekst
   ======================================== */
