/* ====================================
   MODAL ADICIONAR EQUIPA - MOBILE-FIRST DESIGN
   ==================================== */

/* Modal Background */
#equipaModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    backdrop-filter: blur(3px);
    padding: 0;
}

#equipaModal.show {
    display: flex !important;
}

/* Modal Content Container */
.equipa-modal-content {
    background: #000000;
    border: 3px solid #ee8a04;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    margin: 20px;
    animation: slideUpModal 0.3s ease;
    box-shadow: 0 10px 50px rgba(238, 138, 4, 0.6),
                0 0 10px rgba(238, 138, 4, 0.4),
                0 0 80px rgba(238, 138, 4, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

@keyframes slideUpModal {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.equipa-modal-header {
    background: #252525;
    padding: 18px 20px;
    border-radius: 9px 9px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.equipa-modal-header h3 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.equipa-modal-header .close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.equipa-modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.equipa-modal-body {
    padding: 25px;
}

/* Form Styling */
.equipa-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Groups */
.equipa-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.equipa-form-group label {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.equipa-form-group label .required {
    color: #ee8a04;
    margin-left: 2px;
}

.equipa-form-group small {
    color: #999;
    font-size: 12px;
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

/* Input Fields */
.equipa-form-group input[type="text"],
.equipa-form-group input[type="email"],
.equipa-form-group input[type="tel"],
.equipa-form-group input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.equipa-form-group input:focus {
    outline: none;
    border-color: #ee8a04;
    background: #252525;
    box-shadow: 0 0 0 3px rgba(238, 138, 4, 0.1);
}

.equipa-form-group input::placeholder {
    color: #666;
    opacity: 1;
}

/* File Upload - Image Preview */
.equipa-image-upload {
    position: relative;
}

.equipa-upload-area {
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #1a1a1a;
}

.equipa-upload-area:hover {
    border-color: #ee8a04;
    background: #252525;
}

.equipa-upload-area.has-image {
    padding: 15px;
    border-style: solid;
}

.equipa-upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.equipa-upload-text {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 5px;
}

.equipa-upload-hint {
    color: #666;
    font-size: 12px;
}

.equipa-image-preview {
    display: none;
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.equipa-image-preview.show {
    display: block;
}

.equipa-preview-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    background: #0a0a0a;
}

.equipa-remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ee8a04;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.equipa-remove-image:hover {
    background: #d67a03;
    transform: scale(1.1);
}

/* Hidden File Input - Visually hidden but accessible */
#equipaLogo {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Form Actions */
.equipa-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.equipa-btn-secondary {
    background: transparent;
    border: 2px solid #666;
    color: #999;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.equipa-btn-secondary:hover {
    background: rgba(102, 102, 102, 0.1);
    border-color: #999;
    color: #ccc;
}

.equipa-btn-primary {
    background: #ee8a04;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.equipa-btn-primary:hover {
    background: #d67a03;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 138, 4, 0.4);
}

.equipa-btn-primary:active {
    transform: translateY(0);
}

.equipa-btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Success/Error Messages */
.equipa-message {
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.equipa-message.show {
    display: block;
}

.equipa-message.success {
    background: rgba(46, 125, 50, 0.15);
    border: 1px solid #2e7d32;
    color: #4caf50;
}

.equipa-message.error {
    background: rgba(198, 40, 40, 0.15);
    border: 1px solid #c62828;
    color: #ef5350;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.equipa-btn-primary.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ====================================
   RESPONSIVE - TABLET
   ==================================== */
@media (max-width: 768px) {
    .equipa-modal-content {
        width: 95%;
        margin: 10px auto;
    }

    .equipa-modal-body {
        padding: 20px;
    }

    .equipa-form-actions {
        flex-direction: column-reverse;
    }

    .equipa-btn-secondary,
    .equipa-btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* ====================================
   RESPONSIVE - MOBILE
   ==================================== */
@media (max-width: 575px) {
    #equipaModal {
        align-items: flex-end;
        padding: 0;
    }

    .equipa-modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        max-height: 95vh;
        overflow-y: auto;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
            opacity: 1;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .equipa-modal-header {
        padding: 15px 18px;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .equipa-modal-header h3 {
        font-size: 18px;
    }

    .equipa-modal-body {
        padding: 18px;
    }

    .equipa-form {
        gap: 18px;
    }

    .equipa-form-group {
        gap: 6px;
    }

    .equipa-form-group label {
        font-size: 13px;
    }

    .equipa-form-group input {
        padding: 11px 14px;
        font-size: 14px;
    }

    .equipa-form-group small {
        font-size: 11px;
    }

    .equipa-upload-area {
        padding: 25px 15px;
    }

    .equipa-upload-icon {
        font-size: 40px;
    }

    .equipa-upload-text {
        font-size: 13px;
    }

    .equipa-btn-secondary,
    .equipa-btn-primary {
        padding: 14px 20px;
        font-size: 15px;
    }

    .equipa-form-actions {
        margin-top: 20px;
        padding-top: 15px;
        gap: 8px;
    }
}

/* ====================================
   DARK MODE SCROLLBAR
   ==================================== */
.equipa-modal-content::-webkit-scrollbar {
    width: 8px;
}

.equipa-modal-content::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.equipa-modal-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.equipa-modal-content::-webkit-scrollbar-thumb:hover {
    background: #ee8a04;
}
