/* ==========================================================================
   rapidSaveCloud - Index Specific CSS (index.css)
   ========================================================================== */

/* Main Container */
main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    z-index: 2;
}

/* Home Layout Grid */
.home-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 2.25rem;
    align-items: start;
}

@media (max-width: 960px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 550px;
    margin: 0 auto;
}

/* Tabs Navigation */
.tabs-header {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.35rem;
    border-radius: 14px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
    transition: stroke 0.3s ease;
}

.tab-btn.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Drag and Drop Zone */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.04);
}

.dropzone svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    transition: transform 0.4s ease, color 0.3s ease;
}

.dropzone:hover svg,
.dropzone.dragover svg {
    transform: translateY(-4px);
    color: var(--accent-blue);
}

.dropzone p.main-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.dropzone p.sub-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Selected File Card */
.file-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
    animation: slideIn 0.3s ease forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    text-align: left;
}

.file-card-info svg {
    width: 24px;
    height: 24px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.file-details {
    overflow: hidden;
}

.file-name {
    font-weight: 500;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Inputs and Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg.input-icon {
    position: absolute;
    left: 1.25rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.9rem 1.25rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-wrapper input {
    padding-left: 3rem;
}

.input-wrapper textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 180px;
    line-height: 1.5;
    padding: 1.25rem;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Password eye toggles */
.password-toggle {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #fff;
}

/* Access Card Portal styling */
.access-card {
    width: 100%;
}

.access-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.access-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Custom digit entries */
.digit-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.digit-input-wrapper {
    position: relative;
    max-width: 320px;
    margin: 0 auto 1.75rem auto;
}

.access-input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 16px !important;
    padding: 1rem 1.25rem !important;
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-indent: 0.25em;
    /* offsets the letter spacing on the last char */
    font-family: 'Outfit', sans-serif;
    color: #fff;
    transition: all 0.3s ease;
}

.access-input-field:focus {
    outline: none;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 4px var(--accent-glow) !important;
}

/* Decorative Divider */
.divider {
    height: 1px;
    background: var(--border-glass);
    margin: 1.75rem 0;
    position: relative;
}

.divider::before {
    content: "OPTIONS DE SÉCURITÉ";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Mobile responsive */
@media (max-width: 580px) {
    h1 {
        font-size: 2rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    main {
        padding: 1.5rem 1rem;
    }
}

/* Mode Selector Toggle */
.mode-selector-wrapper {
    margin: 1.5rem 0;
    text-align: left;
}
.mode-selector-wrapper label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mode-toggle-container {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    padding: 0.25rem;
    border-radius: 12px;
}
.mode-toggle-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.mode-toggle-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Custom Checkbox */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500 !important;
    margin-bottom: 0.25rem !important;
    user-select: none;
    text-align: left;
}
.checkbox-label input {
    display: none;
}
.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.checkbox-label input:checked + .custom-checkbox {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}
.checkbox-label input:checked + .custom-checkbox::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-text {
    font-size: 0.95rem;
}
.checkbox-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 1.75rem;
    line-height: 1.4;
    text-align: left;
}

/* P2P Overlay Modal */
.p2p-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 22, 0.96);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.p2p-modal-content {
    max-width: 500px;
    width: 90%;
    text-align: center;
    padding: 3rem 2rem;
    border-color: rgba(37, 99, 235, 0.25);
}
.p2p-code-display {
    font-size: 3.25rem;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: 0.15em;
    margin: 1.5rem 0;
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.35);
    font-family: monospace;
}
.p2p-status-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}
.p2p-progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin: 1.5rem 0;
}
.p2p-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #9b51e0);
    transition: width 0.15s ease;
}
.btn-cancel {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 0.65rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1.5rem;
}
.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}