/* ====================================
   CREATE SECTION - ADAPTIVE DESIGN
   ==================================== */

:root {
    --primary: #ffd700;
    --bg: #050505;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text-muted: #888;
    --success-green: #4ade80;
    --error-red: #ff6b6b;
}

/* ====================================
   DESKTOP: MODAL DESIGN
   ==================================== */

.create-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.create-overlay.active {
    display: flex;
    opacity: 1;
}

.create-modal {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.create-overlay.active .create-modal {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: var(--error-red);
    color: var(--error-red);
    transform: rotate(90deg);
}

.create-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.create-header h2 {
    font-size: 2rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, white, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.create-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.create-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.create-option {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.create-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.create-option:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.2);
}

.create-option:hover::before {
    opacity: 1;
}

.option-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
}

.create-option:hover .option-icon {
    background: rgba(255, 215, 0, 0.15);
    color: var(--primary);
    transform: scale(1.1);
}

.option-icon.contest {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
}

.create-option h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: white;
}

.create-option p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

.option-badge {
    display: inline-block;
    background: rgba(74, 222, 128, 0.15);
    color: var(--success-green);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-badge.premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    color: var(--primary);
}

.create-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.help-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.help-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Hide bottom sheet on desktop */
.create-bottom-sheet {
    display: none;
}

/* ====================================
   MOBILE: BOTTOM SHEET DESIGN
   ==================================== */

@media (max-width: 768px) {

    /* Hide desktop modal */
    .create-overlay {
        display: none !important;
    }

    /* Show bottom sheet */
    .create-bottom-sheet {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        border-top-left-radius: 28px;
        border-top-right-radius: 28px;
        z-index: 9999;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
        border: 1px solid var(--border);
        border-bottom: none;
        max-height: 80vh;
        overflow: hidden;
    }

    .create-bottom-sheet.active {
        transform: translateY(0);
    }

    .bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        margin: 1rem auto 0;
    }

    .bottom-sheet-content {
        padding: 1rem 1.5rem 2rem;
    }

    .sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .sheet-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0;
    }

    .sheet-close {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid var(--border);
        color: white;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
    }

    .sheet-close:hover {
        background: rgba(255, 107, 107, 0.15);
        border-color: var(--error-red);
        color: var(--error-red);
    }

    .sheet-options {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .sheet-option {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 1.25rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        cursor: pointer;
        transition: all 0.3s;
        text-align: left;
    }

    .sheet-option:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.08);
    }

    .sheet-option-icon {
        width: 56px;
        height: 56px;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: white;
    }

    .sheet-option-icon.contest {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
        color: var(--primary);
    }

    .sheet-option-content {
        flex: 1;
    }

    .sheet-option-content h3 {
        font-size: 1.125rem;
        font-weight: 700;
        margin: 0 0 0.25rem 0;
        color: white;
    }

    .sheet-option-content p {
        font-size: 0.875rem;
        color: var(--text-muted);
        margin: 0;
    }

    .sheet-option-arrow {
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .sheet-footer {
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .sheet-cancel {
        width: 100%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border);
        color: white;
        padding: 1rem;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
    }

    .sheet-cancel:active {
        background: rgba(255, 255, 255, 0.08);
        transform: scale(0.98);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    .sheet-option,
    .sheet-close,
    .sheet-cancel {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.1);
    }

    .sheet-option {
        min-height: 80px;
    }

    .sheet-cancel {
        min-height: 52px;
    }
}

/* Extra safe area for notched devices */
@media (max-width: 768px) {
    .create-bottom-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .create-modal {
        max-width: 600px;
        padding: 2rem;
    }

    .create-options {
        gap: 1.25rem;
    }

    .create-option {
        padding: 1.75rem 1.25rem;
    }

    .option-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.25rem;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .create-modal {
        padding: 2rem 1.5rem;
    }

    .create-header h2 {
        font-size: 1.75rem;
    }

    .create-options {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .create-option {
        padding: 1.5rem;
    }

    .option-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 1rem;
    }

    .sheet-option {
        padding: 1rem;
    }

    .sheet-option-icon {
        width: 52px;
        height: 52px;
    }

    .sheet-option-content h3 {
        font-size: 1rem;
    }

    .sheet-option-content p {
        font-size: 0.8rem;
    }
}

/* Toast Styles */
.toast {
    position: fixed;
    top: 100px;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideIn 0.3s ease;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .toast {
        right: 1rem;
        left: 1rem;
        top: 80px;
    }
}