/* 
 * MODAL STYLES - STARFLEET SCI-FI DESIGN
 * Zunifikowany styl modali zgodny z common-layout.css
 */

/* ========== MODAL - SCI-FI THEME ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.98) 0%, 
        rgba(22, 33, 62, 0.98) 100%);
    border-radius: 16px;
    max-width: 1000px;
    width: 100%;
    max-height: none;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 80px rgba(0, 184, 255, 0.4);
    border: 2px solid rgba(0, 184, 255, 0.4);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 20px auto;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #00b8ff 0%, 
        #9d4edd 50%, 
        #ffd700 100%);
    animation: scanLine 3s linear infinite;
    z-index: 1;
}

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

@keyframes scanLine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ========== MODAL HEADER ========== */
.modal-header {
    padding: 24px 30px;
    border-bottom: 2px solid rgba(0, 184, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.15) 0%, 
        rgba(157, 78, 221, 0.15) 100%);
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
    position: relative;
    z-index: 2;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    font-family: 'Orbitron', monospace;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-title i {
    font-size: 1.3rem;
    color: #00b8ff;
    text-shadow: 0 0 20px rgba(0, 184, 255, 0.6);
}

.modal-close {
    background: rgba(255, 51, 102, 0.2);
    border: 2px solid rgba(255, 51, 102, 0.4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ff3366;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
}

.modal-close:hover {
    background: rgba(255, 51, 102, 0.3);
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
}

/* ========== MODAL BODY ========== */
.modal-body {
    padding: 30px;
    overflow-y: visible;
    overflow-x: hidden;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for modal */
.modal::-webkit-scrollbar {
    width: 10px;
}

.modal::-webkit-scrollbar-track {
    background: rgba(0, 184, 255, 0.1);
}

.modal::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        #00b8ff 0%, 
        #9d4edd 100%);
    border-radius: 10px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        #66e0ff 0%, 
        #9d4edd 100%);
}

/* ========== INFO BOX ========== */
.form-info {
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.1) 0%, 
        rgba(157, 78, 221, 0.1) 100%);
    border-left: 4px solid #00b8ff;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #c0c0c0;
    margin-bottom: 25px;
    display: flex;
    align-items: start;
    gap: 12px;
    border: 1px solid rgba(0, 184, 255, 0.3);
}

.form-info i {
    color: #00b8ff;
    font-size: 1.2rem;
    margin-top: 2px;
    text-shadow: 0 0 10px rgba(0, 184, 255, 0.5);
}

/* ========== FORM SECTIONS ========== */
.form-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 184, 255, 0.2);
}

.form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section-title i {
    color: #00b8ff;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(0, 184, 255, 0.5);
}

/* ========== FORM GRID - 2 KOLUMNY ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ========== FORM GROUPS ========== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.form-group label,
.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #66e0ff;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label .required,
.form-label .required {
    color: #ff3366;
    margin-left: 4px;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    padding: 12px 16px;
    border: 2px solid rgba(0, 184, 255, 0.4);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    background: rgba(26, 26, 46, 0.8);
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: #00b8ff;
    background: rgba(26, 26, 46, 0.95);
    box-shadow: 0 0 20px rgba(0, 184, 255, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-control::placeholder {
    color: rgba(192, 192, 192, 0.5);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Form validation states */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ff3366;
    background: rgba(255, 51, 102, 0.05);
}

.form-group.error label {
    color: #ff3366;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #00ff9d;
    background: rgba(0, 255, 157, 0.05);
}

.form-group.success label {
    color: #00ff9d;
}

/* ========== COST BREAKDOWN ========== */
.cost-breakdown {
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.05) 0%, 
        rgba(157, 78, 221, 0.05) 100%);
    border: 2px solid rgba(0, 184, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 184, 255, 0.2);
    font-family: 'Orbitron', monospace;
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-label {
    font-size: 0.9rem;
    color: #c0c0c0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cost-value {
    font-size: 1rem;
    font-weight: 600;
    color: #ffd700;
}

.cost-value.net {
    color: #00ff9d;
}

.cost-value.gross {
    color: #ffd700;
    font-size: 1.2rem;
}

.cost-item.total {
    margin-top: 8px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 184, 255, 0.3);
    border-bottom: none;
}

.cost-item.total .cost-label {
    font-size: 1rem;
    font-weight: 700;
    color: #ffd700;
}

.cost-item.total .cost-value {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ========== MODAL FOOTER ========== */
.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid rgba(0, 184, 255, 0.3);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, 
        rgba(0, 184, 255, 0.05) 0%, 
        rgba(157, 78, 221, 0.05) 100%);
    flex-shrink: 0;
    border-radius: 0 0 16px 16px;
}

/* ========== BUTTONS IN MODAL ========== */
.modal-footer .btn {
    padding: 12px 24px;
    border: 2px solid rgba(0, 184, 255, 0.4);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(26, 26, 46, 0.8);
    color: #ffffff;
}

.modal-footer .btn:hover {
    transform: translateY(-2px);
}

.modal-footer .btn-outline {
    background: transparent;
    border-color: rgba(192, 192, 192, 0.4);
    color: #c0c0c0;
}

.modal-footer .btn-outline:hover {
    background: rgba(192, 192, 192, 0.1);
    border-color: #c0c0c0;
    color: #ffffff;
}

.modal-footer .btn-success {
    background: linear-gradient(135deg, 
        #00ff9d 0%, 
        #00cc7a 100%);
    border-color: #00ff9d;
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.4);
}

.modal-footer .btn-success:hover {
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.6);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, 
        #00b8ff 0%, 
        #9d4edd 100%);
    border-color: #00b8ff;
    box-shadow: 0 0 20px rgba(0, 184, 255, 0.4);
}

.modal-footer .btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 184, 255, 0.6);
}

/* ========== UTILITY ========== */
.input-group {
    display: flex;
    gap: 10px;
    align-items: end;
}

.input-group .form-group {
    flex: 1;
}

.input-addon {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 184, 255, 0.1);
    border: 2px solid rgba(0, 184, 255, 0.4);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #00b8ff;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
}

/* ========== READONLY FIELDS ========== */
.readonly-field {
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(0, 184, 255, 0.3);
    color: var(--starfleet-silver);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    padding: 12px;
    border-radius: 8px;
    opacity: 0.8;
    cursor: not-allowed;
}

/* ========== INPUT WITH BUTTON ========== */
.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button .form-control {
    flex: 1;
}

.input-with-button .btn {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    padding: 10px 16px;
}

/* ========== NET COST INFO ========== */
.net-cost-info {
    background: rgba(0, 184, 255, 0.1);
    border: 2px solid rgba(0, 184, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-size: 0.85rem;
    animation: hologram 3s ease-in-out infinite;
}

.net-cost-breakdown {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    font-size: 0.85rem;
}

.net-cost-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 184, 255, 0.1);
}

.net-cost-item:last-child {
    border-bottom: none;
}

.net-cost-item.net-cost-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid rgba(0, 184, 255, 0.3);
    font-weight: 700;
    color: #ffd700;
}

/* ========== PRICE DETAILS ========== */
.price-details {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(0, 184, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 8px;
    font-size: 0.85rem;
    border-left: 4px solid var(--starfleet-blue);
}

.price-detail-item {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 184, 255, 0.1);
}

.price-detail-item:last-child {
    border-bottom: none;
}

.price-detail-value {
    font-weight: 700;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.price-total {
    border-top: 2px solid rgba(0, 184, 255, 0.3);
    margin-top: 10px;
    padding-top: 10px;
    font-weight: bold;
    color: var(--starfleet-white);
    font-size: 1rem;
}

/* ========== PRODUCT CODE STYLE ========== */
.product-code {
    font-family: 'Courier New', monospace;
    background: rgba(0, 20, 40, 0.8);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #00ff9d;
    letter-spacing: 3px;
    border: 1px solid rgba(0, 255, 157, 0.3);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
    position: relative;
    overflow: hidden;
}

.product-code::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(0, 255, 157, 0.2),
        transparent);
    animation: scan 2s linear infinite;
}

/* ========== STATUS BADGES ========== */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 3px;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid;
    animation: hologram 3s ease-in-out infinite;
}

.status-success {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
    border-color: rgba(0, 255, 157, 0.3);
}

.status-warning {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
    animation: glitch 1s ease-in-out infinite;
}

.status-danger {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
    border-color: rgba(255, 51, 102, 0.3);
    animation: pulse 0.8s ease-in-out infinite;
}

.status-default {
    background: rgba(192, 192, 192, 0.15);
    color: #c0c0c0;
    border-color: rgba(192, 192, 192, 0.3);
}

/* ========== ANIMATIONS ========== */
@keyframes hologram {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ========== RESPONSIVE - TABLET ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .modal-content {
        max-width: 900px;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: none;
        margin: 10px auto;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-section {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .cost-breakdown {
        padding: 15px;
    }
    
    .form-info {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .input-with-button .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
    }
}

@media (min-width: 1025px) {
    .modal-content {
        max-width: 1000px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-content,
    .modal-content::before,
    .form-group input,
    .form-group select,
    .form-group textarea {
        animation: none;
        transition: none;
    }
}