/* ========================================================================= */
/* COMPONENTS.CSS - Reusable Component Library for Share3D.space            */
/* ========================================================================= */

/* ========================================================================= */
/* 1. BUTTONS                                                                */
/* ========================================================================= */

/* Primary CTA Button */
.btn-primary {
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.95rem;
    background: var(--accent-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 36px;
    border-radius: var(--border-radius-full, 999px);
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(47, 123, 255, 0.3);
    width: auto;
    margin-top: 24px;
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus:not(:disabled) {
    background: #4d8fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(47, 123, 255, 0.4);
    color: #ffffff;
}

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

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

/* Full-width variant for forms */
.btn-primary.btn-block {
    width: 100%;
}

/* Brand/Navigation Button */
.btn-brand {
    position: fixed;
    top: 20px;
    right: 24px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    background: rgba(16, 18, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 18px;
    border-radius: var(--border-radius-full, 999px);
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 1000;
}

.btn-brand:hover,
.btn-brand:focus {
    background: rgba(47, 123, 255, 0.25);
    color: #ffffff;
}

/* ========================================================================= */
/* 2. CARDS & CONTAINERS                                                     */
/* ========================================================================= */

.card {
    background: var(--panel-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg, 24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: visible;
}

.card-body {
    padding: 50px 40px;
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 40px 30px;
    background: rgba(18, 20, 26, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg, 24px);
}

/* ========================================================================= */
/* 3. FORMS                                                                  */
/* ========================================================================= */

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-sm, 12px);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.15);
}

.form-input::placeholder {
    color: rgba(181, 188, 203, 0.5);
}

/* File Upload Area */
.file-upload-area {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 24px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-md, 16px);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.file-upload-area:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

.file-upload-area.drag-over {
    background: rgba(47, 123, 255, 0.1);
    border-color: var(--accent-color);
}

.file-upload-area svg {
    width: 40px;
    height: 40px;
    color: var(--muted-color);
}

.file-upload-area span {
    margin-left: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

/* ========================================================================= */
/* 4. ALERTS & MESSAGES                                                      */
/* ========================================================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm, 12px);
    margin-bottom: 16px;
    margin-top: 16px;
    font-weight: 500;
    line-height: 1.5;
}

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

.alert-success {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    color: var(--accent-color);
    background: rgba(47, 123, 255, 0.15);
    border: 1px solid rgba(47, 123, 255, 0.3);
}

/* Message Box */
.message-box {
    padding: 32px;
    border-radius: var(--border-radius-md, 16px);
    text-align: center;
    margin-top: 32px;
}

.message-box.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.message-box.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.message-box-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
}

.message-box-body {
    color: var(--muted-color);
    line-height: 1.6;
}

/* ========================================================================= */
/* 5. LOADING STATES                                                         */
/* ========================================================================= */

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border-left-color: var(--accent-color);
    animation: spin 1s linear infinite;
    margin: 6px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(12, 15, 20, 0.75), rgba(12, 15, 20, 0.42));
    backdrop-filter: blur(8px);
    gap: 12px;
    text-align: center;
}

.overlay p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted-color);
}

.overlay strong {
    color: var(--text-color);
    font-size: 1.1rem;
    letter-spacing: 0.03em;
}

/* ========================================================================= */
/* 6. TYPOGRAPHY                                                             */
/* ========================================================================= */

.text-heading {
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.text-subtitle {
    text-align: center;
    color: var(--muted-color);
    margin-bottom: 40px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.text-muted {
    color: var(--muted-color);
}

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

/* ========================================================================= */
/* 7. UTILITIES                                                              */
/* ========================================================================= */

.hidden {
    display: none !important;
}

.relative {
    position: relative;
}

/* Image Preview Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    margin-top: 12px;
}

.image-grid img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: var(--border-radius-sm, 12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-grid .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--bg-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-grid .relative:hover .remove-btn {
    opacity: 1;
}

/* Footer */
.footer-fixed {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 1.3rem;
    color: var(--muted-color);
    padding: 8px 16px;
    background: rgba(16, 18, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-full, 999px);
    z-index: 1000;
}

/* Link Styles */
.link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover,
.link:focus {
    color: #4d8fff;
}

.link-muted {
    color: var(--muted-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-muted:hover,
.link-muted:focus {
    color: #4d8fff;
}

/* ========================================================================= */
/* 8. RESPONSIVE UTILITIES                                                   */
/* ========================================================================= */

@media (max-width: 720px) {
    .btn-brand {
        top: 16px;
        right: 16px;
        padding: 8px 14px;
        font-size: 0.75rem;
    }
}

@media (max-width: 640px) {
    .card-body {
        padding: 40px 24px;
    }

    .card-content {
        padding: 40px 30px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .image-grid img {
        height: 70px;
    }
}