/* Quiltt Scrabble - Shared Styles */

/* Scrabblish Font */
@font-face {
    font-family: 'Scrabblish';
    src: url('../fonts/scrabblish-webfont.woff2') format('woff2'),
         url('../fonts/scrabblish-webfont.woff') format('woff'),
         url('../fonts/Scrabblish.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --quiltt-teal: #00A5A8;
    --quiltt-teal-dark: #008385;
    --quiltt-teal-light: #4DC9CB;
    
    --tile-cream: #f5e6c8;
    --tile-cream-dark: #e8d4a8;
    --tile-shadow: #c9b896;
    
    --board-green: #1a5f4a;
    --board-green-light: #2a7d62;
    --board-green-dark: #0f3d2d;
    
    --bonus-dw: #f5a3a3;
    --bonus-tw: #e85454;
    --bonus-dl: #a3c4f5;
    --bonus-tl: #5490dc;
    --center-star: #f5d454;
    
    /* Pastel Palette - matching Jeopardy */
    --pastel-blue: #E8F4F8;
    --pastel-mint: #E0F5F5;
    --pastel-lavender: #F0E8F5;
    --pastel-peach: #FFF0E8;
    --pastel-yellow: #FFF8E0;
    
    /* Light theme colors */
    --bg-light: #F5F8FA;
    --bg-white: #FFFFFF;
    --card-bg: #FFFFFF;
    --card-border: #E0E8EF;
    --text-dark: #2D3748;
    --text-medium: #4A5568;
    --text-muted: #718096;
    --success: #48BB78;
    --error: #F56565;
    --warning: #ECC94B;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    --font-display: 'Fredoka', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-tiles: 'Scrabblish', 'Fredoka', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-body);
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Tile Styles */
.tile {
    background: linear-gradient(145deg, var(--tile-cream) 0%, var(--tile-cream-dark) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-tiles);
    font-weight: normal;
    color: #2d2d2d;
    position: relative;
    box-shadow: 
        0 3px 0 var(--tile-shadow),
        0 4px 8px rgba(0,0,0,0.2);
    user-select: none;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:active {
    cursor: grabbing;
}

.tile.dragging {
    transform: scale(1.1);
    box-shadow: 
        0 6px 0 var(--tile-shadow),
        0 12px 24px rgba(0,0,0,0.3);
    z-index: 100;
}

.tile .points {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.5em;
    font-weight: 600;
    color: #666;
}

.tile.blank {
    background: linear-gradient(145deg, #e8e0d0 0%, #d4ccbc 100%);
}

.tile.blank .letter {
    color: #666;
    font-style: italic;
}

/* Board Cell Styles */
.board-cell {
    background: var(--board-green-light);
    border: 1px solid var(--board-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s ease;
}

.board-cell.double-letter {
    background: var(--bonus-dl);
}

.board-cell.triple-letter {
    background: var(--bonus-tl);
}

.board-cell.double-word {
    background: var(--bonus-dw);
}

.board-cell.triple-word {
    background: var(--bonus-tw);
}

.board-cell.center {
    background: var(--center-star);
}

.board-cell .bonus-label {
    font-family: var(--font-display);
    font-size: 0.5em;
    font-weight: 600;
    color: rgba(0,0,0,0.5);
    text-transform: uppercase;
    line-height: 1.1;
    text-align: center;
}

.board-cell.has-tile .bonus-label {
    display: none;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--quiltt-teal), var(--quiltt-teal-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(0, 165, 168, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 165, 168, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: var(--pastel-mint);
    border-color: var(--quiltt-teal);
    color: var(--quiltt-teal-dark);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 1.5rem;
}

/* Score Badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 165, 168, 0.2);
    border: 1px solid rgba(0, 165, 168, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-family: var(--font-display);
    font-weight: 600;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--card-border);
    border-top-color: var(--quiltt-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    max-width: 350px;
    box-shadow: var(--shadow-lg);
    color: var(--text-dark);
}

.toast.success {
    border-color: var(--success);
    background: #F0FFF4;
}

.toast.error {
    border-color: var(--error);
    background: #FED7D7;
}

.toast.info {
    border-color: var(--quiltt-teal);
    background: var(--pastel-mint);
}

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

/* Responsive utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

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

.modal h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-dark);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons .btn {
    flex: 1;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}
