/* Sudoku Game External Styles */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

/* Mobile Form Resubmission Prevention */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Re-enable text selection for specific elements */
input, textarea, .selectable {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    body {
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea, button {
        font-size: 16px !important;
        transform: translateZ(0);
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Disable pull-to-refresh */
    .container {
        overscroll-behavior: contain;
    }
}

/* Prevent form elements from appearing */
form {
    display: none !important;
}

/* Base Body Styles */
body {
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode support */
.dark body {
    background: linear-gradient(135deg, #272640 0%, #212f45 30%, #1b3a4b 60%, #144552 100%);
}

/* Sudoku Cell Styles */
.sudoku-cell {
    width: 100%;
    height: 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 6px rgba(52, 160, 164, 0.1);
    border-radius: 4px;
}

/* Dark mode sudoku cell */
.dark .sudoku-cell {
    background: linear-gradient(135deg, #1b3a4b 0%, #212f45 100%);
    border: 1px solid #144552;
    color: #adfeff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sudoku-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(52, 160, 164, 0.2);
    background: #f7fbe9;
}

.sudoku-cell.selected {
    box-shadow: 0 0 0 3px #52b69a, 0 6px 20px rgba(52, 182, 154, 0.3);
    transform: scale(1.02);
    background: #dcf1eb;
    color: #064e3b;
    z-index: 10;
    position: relative;
}

.sudoku-cell.same-number {
    background: #c7ecf8 !important;
    transform: scale(1.01);
    box-shadow: 0 3px 10px rgba(26, 117, 159, 0.2);
}

.sudoku-cell.highlight-row,
.sudoku-cell.highlight-col,
.sudoku-cell.highlight-box {
    background: #f0fae8 !important;
    box-shadow: 0 3px 10px rgba(52, 160, 164, 0.15);
}

.sudoku-cell.invalid {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    animation: shake 0.5s ease-in-out;
}

/* Kalıcı hata durumu - shake animasyonu olmadan */
.sudoku-cell.permanent-error {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3) !important;
}

/* Dark mode invalid cell */
.dark .sudoku-cell.invalid {
    background: linear-gradient(135deg, #4d194d 0%, #3e1f47 100%) !important;
    color: #ebc1eb !important;
    border-color: #c346c3;
    box-shadow: 0 0 8px rgba(195, 70, 195, 0.2);
}

/* Dark mode kalıcı hata durumu */
.dark .sudoku-cell.permanent-error {
    background: linear-gradient(135deg, #4d194d 0%, #3e1f47 100%) !important;
    color: #ebc1eb !important;
    border-color: #c346c3 !important;
    box-shadow: 0 0 8px rgba(195, 70, 195, 0.4) !important;
}

.sudoku-cell.given {
    background: #ffffff;
    font-weight: 600;
    color: #184e77;
}

/* Dark mode given cell */
.dark .sudoku-cell.given {
    background: linear-gradient(135deg, #1b3a4b 0%, #212f45 100%);
    color: #b2f5fa;
    font-weight: 600;
    border-color: #144552;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Sudoku Grid */
.sudoku-grid {
    background: white;
    border: none;
    position: relative;
    overflow: hidden;
    width: min(450px, 90vw);
    height: min(450px, 90vw);
    aspect-ratio: 1;
    box-shadow: 0 8px 32px rgba(52, 160, 164, 0.12);
    border-radius: 12px;
    padding: 8px;
    gap: 2px;
}

/* Dark mode sudoku grid */
.dark .sudoku-grid {
    background: linear-gradient(135deg, rgba(27, 58, 75, 0.95) 0%, rgba(33, 47, 69, 0.95) 50%, rgba(39, 38, 64, 0.95) 100%);
    border: 2px solid rgba(0, 100, 102, 0.6);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Number Button Styles */
.number-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(52, 160, 164, 0.1);
    border-radius: 8px;
}

.number-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.number-button:hover::before {
    left: 100%;
}

.number-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(52, 160, 164, 0.2);
}

.number-button:active {
    transform: translateY(-1px) scale(1.02);
}

.number-button.selected-number {
    background: #52b69a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 182, 154, 0.3);
}

/* Disabled number button styles */
.number-btn:disabled,
.number-btn.opacity-50 {
    background: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(148, 163, 184, 0.1) !important;
}

.number-btn:disabled:hover,
.number-btn.opacity-50:hover {
    transform: none !important;
    box-shadow: 0 1px 3px rgba(148, 163, 184, 0.1) !important;
    background: #f8fafc !important;
}

/* Stats Section */
.stats-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Dark mode stats section - Minimal shadow */
.dark .stats-section {
    background: linear-gradient(135deg, rgba(20, 69, 82, 0.9) 0%, rgba(27, 58, 75, 0.9) 100%);
    border: 1px solid rgba(0, 100, 102, 0.4);
    color: #adfeff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Difficulty Button Styles */
.difficulty-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: #f8fafc;
}

.difficulty-btn:active {
    transform: translateY(-1px);
}

.difficulty-btn.active {
    background: #1e3a8a;
    color: white;
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

/* Simple Difficulty Buttons */
.simple-difficulty-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #52b69a;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(52, 182, 154, 0.1);
}

.simple-difficulty-btn:hover {
    background: #dcf1eb;
    color: #34a0a4;
}

.simple-difficulty-btn.active {
    background: #52b69a;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 182, 154, 0.3);
}

/* Control Buttons - Modern Professional Style */
.control-btn {
    width: 100%;
    min-height: 56px;
    padding: 6px 0;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: white;
    color: #374151;
    box-shadow: 0 2px 8px rgba(52, 160, 164, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 160, 164, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.control-btn i, .control-btn svg {
    font-size: 18px;
    pointer-events: none;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

/* Default state for all control buttons */
.control-btn {
    background: white;
    color: #374151;
}

/* Individual button styles with unique selectors */
.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 160, 164, 0.2);
}

.control-btn:hover::before {
    opacity: 1;
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 160, 164, 0.1);
}

button[data-btn="notes"] {
    background: #f0fae8;
    color: #365314;
    border: 1px solid #d1fae5;
}

button[data-btn="notes"]:hover:not(.notes-active) {
    background: #e3f4e9;
    color: #1a2e05;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 200, 147, 0.25);
    border: 1px solid #a7f3d0;
}

/* Notes button active state with cleaner modern style */
.notes-active {
    background: #76c893 !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(118, 200, 147, 0.4) !important;
}

/* Auto Candidates button styles */
button[data-btn="auto-candidates"] {
    background: #c7ecf8;
    color: #0c4a6e;
    border: 1px solid #bae6fd;
}

button[data-btn="auto-candidates"]:hover:not(.auto-candidates-active) {
    background: #8fcfed;
    color: #082f49;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 117, 159, 0.25);
    border: 1px solid #7dd3fc;
}

.auto-candidates-active {
    background: #1a759f !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(26, 117, 159, 0.4) !important;
    border: 1px solid #38bdf8 !important;
}

button[data-btn="clear"] {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

button[data-btn="clear"]:hover {
    background: #fecaca;
    color: #991b1b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 29, 29, 0.25);
    border: 1px solid #fca5a5;
}

button[data-btn="hint"] {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

button[data-btn="hint"]:hover {
    background: #fde68a;
    color: #b45309;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(146, 64, 14, 0.25);
    border: 1px solid #fcd34d;
}

button[data-btn="share"] {
    background: #d2f0f1;
    color: #0a2021;
    border: 1px solid #a5e1e3;
}

button[data-btn="share"]:hover {
    background: #78d1d4;
    color: #134e4a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 160, 164, 0.25);
    border: 1px solid #4bc2c6;
}

/* Active states */
.control-btn:active {
    transform: translateY(0) scale(0.98);
}

.number-btn:hover .relative {
    z-index: 10;
}

.celebration {
    animation: celebration 1s ease-in-out;
}

/* Sudoku grid sizing */
#sudoku-grid {
    width: min(500px, 90vw);
    height: min(500px, 90vw);
    aspect-ratio: 1;
}

.sudoku-cell {
    aspect-ratio: 1;
    min-height: 0;
    min-width: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .controls-section .stats-section {
        order: -1;
        margin-bottom: 1rem;
    }
    
    /* Smaller font for mobile sudoku cells */
    .sudoku-cell {
        font-size: 1.2rem;
    }
}

@media (min-width: 1024px) {
    #sudoku-grid {
        width: 550px;
        height: 550px;
    }
    
    /* Larger font for desktop */
    .sudoku-cell {
        font-size: 1.8rem;
    }
}

/* Extra large screens - even bigger grid */
@media (min-width: 1440px) {
    #sudoku-grid {
        width: 600px;
        height: 600px;
    }
    
    /* Even larger font for extra large screens */
    .sudoku-cell {
        font-size: 2.2rem;
    }
}

/* Ultra wide screens */
@media (min-width: 1920px) {
    #sudoku-grid {
        width: 650px;
        height: 650px;
    }
    
    /* Maximum font size for ultra wide screens */
    .sudoku-cell {
        font-size: 2.5rem;
    }
}

/* Game container layout */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .game-container {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .sudoku-section {
        flex-shrink: 0;
    }
    
    .controls-section {
        flex: 1;
        max-width: 380px;
        min-width: 320px;
    }
}

.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Notification System */
.notification {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: rgba(97, 139, 58, 0.9);
    color: white;
}

.notification.error {
    background: rgba(20, 60, 82, 0.9);
    color: white;
}

.notification.info {
    background: rgba(66, 122, 161, 0.9);
    color: white;
}

.notification.warning {
    background: rgba(135, 169, 107, 0.9);
    color: white;
}

/* Loading spinner styles */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.spinner-ring {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(66, 122, 161, 0.2);
    border-radius: 50%;
    border-top-color: #427aa1;
    animation: spin 1s ease-in-out infinite;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-radius: inherit;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.loading-text {
    margin-top: 20px;
    color: #143c52;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Dark mode modals and overlays - Traditional screen effects */
.dark .loading-overlay {
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(180, 83, 9, 0.3);
}

.dark .loading-text {
    color: #f59e0b;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark .spinner-ring {
    border-color: rgba(245, 158, 11, 0.2);
    border-top-color: #f59e0b;
}

/* SVG Icon Styles */
.svg-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    fill: currentColor;
    vertical-align: middle;
    transition: transform 0.2s ease;
    stroke-width: 0.7px;
    margin: auto;
}

.svg-icon.spin {
    animation: spin 1s linear infinite;
}

/* Icon hover effects */
button:hover .svg-icon {
    transform: scale(1.1);
}

.control-btn:hover .svg-icon {
    transform: scale(1.15);
}

/* Specific icon sizes */
.svg-icon.mr-2 {
    margin-right: 0.5rem;
}

.svg-icon.mr-3 {
    margin-right: 0.75rem;
}

button[data-btn="share"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

button[data-btn="share"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

/* Dark mode control buttons - Modern Dark Elegant */
.dark .control-btn {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: none;
}

.dark .control-btn::before {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
}

.dark .control-btn:hover {
    background: linear-gradient(135deg, #0f172a 0%, #0f172a 100%);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    color: #f8fafc;
    transform: translateY(-2px);
}

.dark .control-btn:hover::before {
    opacity: 1;
}

/* Dark mode button-specific styles */
.dark button[data-btn="notes"] {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    color: #bae6fd;
}

.dark button[data-btn="notes"]:hover:not(.notes-active) {
    background: linear-gradient(135deg, #075985 0%, #0369a1 100%);
    color: #e0f2fe;
}

.dark .notes-active {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%) !important;
    color: #f0f9ff !important;
    box-shadow: 0 4px 12px rgba(7, 89, 133, 0.4) !important;
}

.dark button[data-btn="auto-candidates"] {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: #a7f3d0;
}

.dark button[data-btn="auto-candidates"]:hover:not(.auto-candidates-active) {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    color: #d1fae5;
}

.dark .auto-candidates-active {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%) !important;
    color: #ecfdf5 !important;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.4) !important;
}

.dark button[data-btn="clear"] {
    background: linear-gradient(135deg, #881337 0%, #9f1239 100%);
    color: #fecdd3;
}

.dark button[data-btn="clear"]:hover {
    background: linear-gradient(135deg, #9f1239 0%, #be123c 100%);
    color: #ffe4e6;
}

.dark button[data-btn="hint"] {
    background: linear-gradient(135deg, #713f12 0%, #854d0e 100%);
    color: #fef9c3;
}

.dark button[data-btn="hint"]:hover {
    background: linear-gradient(135deg, #854d0e 0%, #a16207 100%);
    color: #fefce8;
}

.dark button[data-btn="share"] {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #bfdbfe;
}

.dark button[data-btn="share"]:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #dbeafe;
}

/* Dark mode difficulty buttons - Modern dark elegant */
.dark .simple-difficulty-btn {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.dark .simple-difficulty-btn:hover {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    color: #f8fafc;
    color: #0afbff;
    box-shadow: 0 3px 10px rgba(0, 100, 102, 0.2);
}

.dark .simple-difficulty-btn.active {
    background: linear-gradient(135deg, #006466 0%, #0ba2ad 100%);
    color: #001414;
    border-color: #0afbff;
    box-shadow: 0 4px 12px rgba(10, 251, 255, 0.3);
    font-weight: 700;
}

/* Dark mode text colors - Ocean foam */
.dark h1 {
    color: #adfeff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark .text-ucla_blue-600 {
    color: #b2f5fa !important;
}

.dark .text-lapis_lazuli-700 {
    color: #adfeff !important;
}

.dark .text-lapis_lazuli-800 {
    color: #adfeff !important;
}

/* Dark mode notes text - Better visibility for gray-500 */
.dark .text-gray-500 {
    color: #94a3b8 !important;
}

/* Dark mode disabled buttons */
.dark .number-btn:disabled,
.dark .number-btn.opacity-50 {
    background: linear-gradient(135deg, #144552 0%, #1b3a4b 100%) !important;
    color: #3aafcf !important;
    border-color: #212f45 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Dark mode toggle button - Ocean gem */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #006466 0%, #065a60 100%);
    color: #adfeff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 100, 102, 0.3);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 100, 102, 0.4);
}

.dark .dark-mode-toggle {
    background: linear-gradient(135deg, #0afbff 0%, #0ba2ad 100%);
    box-shadow: 0 3px 10px rgba(10, 251, 255, 0.3);
    color: #001414;
}

.dark .dark-mode-toggle:hover {
    box-shadow: 0 4px 15px rgba(10, 251, 255, 0.4);
}

/* Dark mode notifications - Ocean messages */
.dark .notification.success {
    background: rgba(6, 100, 102, 0.95);
    border: 1px solid rgba(10, 251, 255, 0.5);
    color: #adfeff;
    box-shadow: 0 3px 10px rgba(0, 100, 102, 0.2);
}

.dark .notification.error {
    background: rgba(77, 25, 77, 0.95);
    border: 1px solid rgba(195, 70, 195, 0.5);
    color: #ebc1eb;
    box-shadow: 0 3px 10px rgba(77, 25, 77, 0.2);
}

.dark .notification.info {
    background: rgba(20, 69, 82, 0.95);
    border: 1px solid rgba(11, 162, 173, 0.5);
    color: #b2f5fa;
    box-shadow: 0 3px 10px rgba(20, 69, 82, 0.2);
}

.dark .notification.warning {
    background: rgba(49, 34, 68, 0.95);
    border: 1px solid rgba(121, 102, 163, 0.5);
    color: #c8d3e4;
    box-shadow: 0 3px 10px rgba(49, 34, 68, 0.2);
}

/* Dark mode modals and overlays - Deep ocean effects */
.dark .loading-overlay {
    background: rgba(20, 69, 82, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 100, 102, 0.3);
}

.dark .loading-text {
    color: #0afbff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark .spinner-ring {
    border-color: rgba(10, 251, 255, 0.2);
    border-top-color: #0afbff;
}

/* Dark mode game completion styles - Bioluminescent effect */
.dark .celebration {
    box-shadow: 0 0 20px rgba(10, 251, 255, 0.4);
}

/* Dark mode special highlights - Ocean phosphorescence */
.dark .sudoku-cell.highlighted {
    background: linear-gradient(135deg, #0ba2ad 0%, #19e2f0 100%) !important;
    color: #001414 !important;
    border-color: #5cfcff;
    box-shadow: 0 0 12px rgba(92, 252, 255, 0.4);
}

/* Dark mode focus states - Deep sea glow */
.dark input:focus,
.dark textarea:focus {
    border-color: #0afbff;
    box-shadow: 0 0 8px rgba(10, 251, 255, 0.3);
    background: rgba(27, 58, 75, 0.8);
    color: #adfeff;
}

/* Compact Modal Styling */
#success-modal:not(.hidden),
#game-over-modal:not(.hidden) {
    display: flex !important;
}

#success-modal.hidden,
#game-over-modal.hidden {
    display: none !important;
}

/* Modal animations and effects */
#success-modal .animate-celebration {
    animation: celebration 0.6s ease-out;
}

@keyframes celebration {
    0% { 
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    50% { 
        transform: scale(1.05) translateY(-5px);
        opacity: 1;
    }
    100% { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Modal backdrop blur enhancement */
#success-modal,
#game-over-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* =============================================
   DARK MODE STYLES - OCEAN DEPTHS INSPIRED
   ============================================= */

/* Ocean depth color palette:
   Caribbean Current: #006466 (main highlights)
   Midnight Green: #065a60, #0b525b, #144552 (backgrounds)
   Charcoal: #1b3a4b (grid backgrounds)
   Prussian Blue: #212f45 (secondary elements)
   Space Cadet: #272640 (deep backgrounds)
   Dark Purple: #312244, #3e1f47 (accent colors)
   Palatinate: #4d194d (special highlights)
*/

/* Dark mode body background - Deep ocean gradient */
.dark body {
    background: linear-gradient(135deg, #272640 0%, #212f45 30%, #1b3a4b 60%, #144552 100%);
}

/* Dark mode sudoku grid - Ocean surface effect */
.dark .sudoku-grid {
    background: linear-gradient(135deg, rgba(27, 58, 75, 0.95) 0%, rgba(33, 47, 69, 0.95) 50%, rgba(39, 38, 64, 0.95) 100%);
    border: 2px solid rgba(0, 100, 102, 0.6);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Dark mode sudoku cells - Deep water texture */
.dark .sudoku-cell {
    background: linear-gradient(135deg, #1b3a4b 0%, #212f45 100%);
    border: 1px solid #144552;
    color: #adfeff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dark .sudoku-cell:hover {
    background: linear-gradient(135deg, #212f45 0%, #272640 100%);
    box-shadow: 0 0 8px rgba(0, 100, 102, 0.2);
    border-color: #006466;
    color: #0afbff;
}

.dark .sudoku-cell.selected {
    background: linear-gradient(135deg, #006466 0%, #065a60 100%) !important;
    color: #adfeff !important;
    border-color: #0afbff;
    box-shadow: 0 0 10px rgba(10, 251, 255, 0.3);
}

.dark .sudoku-cell.invalid {
    background: linear-gradient(135deg, #4d194d 0%, #3e1f47 100%) !important;
    color: #ebc1eb !important;
    border-color: #c346c3;
    box-shadow: 0 0 8px rgba(195, 70, 195, 0.2);
}

.dark .sudoku-cell.given {
    background: linear-gradient(135deg, #1b3a4b 0%, #212f45 100%);
    color: #b2f5fa;
    font-weight: 600;
    border-color: #144552;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dark mode highlight classes - Single color highlight */
.dark .sudoku-cell.highlight-row,
.dark .sudoku-cell.highlight-col,
.dark .sudoku-cell.highlight-box {
    background: linear-gradient(135deg, #0f4c75 0%, #1e6091 100%) !important;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #dbeafe !important;
}

/* Dark mode same number highlighting - Minimal shadow */
.dark .sudoku-cell.same-number {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%) !important;
    transform: scale(1.02);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
    border-color: #38bdf8;
    color: #ffffff !important;
    font-weight: 600;
}

/* 3x3 Section Borders - Light Mode */
.sudoku-cell.border-top-3x3 {
    border-top: 3px solid #6b7280 !important;
}
.sudoku-cell.border-left-3x3 {
    border-left: 3px solid #6b7280 !important;
}
.sudoku-cell.border-bottom-3x3 {
    border-bottom: 3px solid #6b7280 !important;
}
.sudoku-cell.border-right-3x3 {
    border-right: 3px solid #6b7280 !important;
}

/* 3x3 Section Borders - Dark Mode */
.dark .sudoku-cell.border-top-3x3 {
    border-top: 3px solid #0afbff !important;
}
.dark .sudoku-cell.border-left-3x3 {
    border-left: 3px solid #0afbff !important;
}
.dark .sudoku-cell.border-bottom-3x3 {
    border-bottom: 3px solid #0afbff !important;
}
.dark .sudoku-cell.border-right-3x3 {
    border-right: 3px solid #0afbff !important;
}

/* Dark mode stats section - Minimal shadow */
.dark .stats-section {
    background: linear-gradient(135deg, rgba(20, 69, 82, 0.9) 0%, rgba(27, 58, 75, 0.9) 100%);
    border: 1px solid rgba(0, 100, 102, 0.4);
    color: #adfeff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Dark mode number buttons - Deep ocean stones */
.dark .number-btn {
    background: linear-gradient(135deg, #144552 0%, #1b3a4b 100%);
    color: #adfeff;
    border: 1px solid #0b525b;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4), 
        inset 0 1px 0 rgba(0, 100, 102, 0.1);
}

.dark .number-btn:hover {
    background: linear-gradient(135deg, #1b3a4b 0%, #212f45 100%);
    box-shadow: 0 4px 12px rgba(0, 100, 102, 0.2);
    border-color: #006466;
    color: #0afbff;
    transform: translateY(-2px);
}

.dark .number-btn.selected-number {
    background: linear-gradient(135deg, #006466 0%, #065a60 100%);
    color: #adfeff;
    border-color: #0afbff;
    box-shadow: 0 6px 15px rgba(10, 251, 255, 0.3);
}

/* Other control buttons with modern styling */
button[data-btn="clear"] {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    color: #be123c;
}

button[data-btn="clear"]:hover {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    color: #9f1239;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(190, 18, 60, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

button[data-btn="hint"] {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    color: #854d0e;
}

button[data-btn="hint"]:hover {
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    color: #713f12;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(133, 77, 14, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

button[data-btn="share"] {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
}

button[data-btn="share"]:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(30, 64, 175, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode control buttons - Modern Dark Elegant */
.dark .control-btn {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: none;
}

.dark .control-btn::before {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
}

.dark .control-btn:hover {
    background: linear-gradient(135deg, #0f172a 0%, #0f172a 100%);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    color: #f8fafc;
    transform: translateY(-2px);
}

.dark .control-btn:hover::before {
    opacity: 1;
}

/* Dark mode button-specific styles */
.dark button[data-btn="notes"] {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    color: #bae6fd;
}

.dark button[data-btn="notes"]:hover:not(.notes-active) {
    background: linear-gradient(135deg, #075985 0%, #0369a1 100%);
    color: #e0f2fe;
}

.dark .notes-active {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%) !important;
    color: #f0f9ff !important;
    box-shadow: 0 4px 12px rgba(7, 89, 133, 0.4) !important;
}

.dark button[data-btn="auto-candidates"] {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: #a7f3d0;
}

.dark button[data-btn="auto-candidates"]:hover:not(.auto-candidates-active) {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    color: #d1fae5;
}

.dark .auto-candidates-active {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%) !important;
    color: #ecfdf5 !important;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.4) !important;
}

.dark button[data-btn="clear"] {
    background: linear-gradient(135deg, #881337 0%, #9f1239 100%);
    color: #fecdd3;
}

.dark button[data-btn="clear"]:hover {
    background: linear-gradient(135deg, #9f1239 0%, #be123c 100%);
    color: #ffe4e6;
}

.dark button[data-btn="hint"] {
    background: linear-gradient(135deg, #713f12 0%, #854d0e 100%);
    color: #fef9c3;
}

.dark button[data-btn="hint"]:hover {
    background: linear-gradient(135deg, #854d0e 0%, #a16207 100%);
    color: #fefce8;
}

.dark button[data-btn="share"] {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #bfdbfe;
}

.dark button[data-btn="share"]:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #dbeafe;
}

/* Dark mode difficulty buttons - Modern dark elegant */
.dark .simple-difficulty-btn {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.dark .simple-difficulty-btn:hover {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    color: #f8fafc;
    color: #0afbff;
    box-shadow: 0 3px 10px rgba(0, 100, 102, 0.2);
}

.dark .simple-difficulty-btn.active {
    background: linear-gradient(135deg, #006466 0%, #0ba2ad 100%);
    color: #001414;
    border-color: #0afbff;
    box-shadow: 0 4px 12px rgba(10, 251, 255, 0.3);
    font-weight: 700;
}

/* Dark mode text colors - Ocean foam */
.dark h1 {
    color: #adfeff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark .text-ucla_blue-600 {
    color: #b2f5fa !important;
}

.dark .text-lapis_lazuli-700 {
    color: #adfeff !important;
}

.dark .text-lapis_lazuli-800 {
    color: #adfeff !important;
}

/* Dark mode notes text - Better visibility for gray-500 */
.dark .text-gray-500 {
    color: #94a3b8 !important;
}

/* Dark mode disabled buttons */
.dark .number-btn:disabled,
.dark .number-btn.opacity-50 {
    background: linear-gradient(135deg, #144552 0%, #1b3a4b 100%) !important;
    color: #3aafcf !important;
    border-color: #212f45 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Dark mode toggle button - Ocean gem */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #006466 0%, #065a60 100%);
    color: #adfeff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 100, 102, 0.3);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 100, 102, 0.4);
}

.dark .dark-mode-toggle {
    background: linear-gradient(135deg, #0afbff 0%, #0ba2ad 100%);
    box-shadow: 0 3px 10px rgba(10, 251, 255, 0.3);
    color: #001414;
}

.dark .dark-mode-toggle:hover {
    box-shadow: 0 4px 15px rgba(10, 251, 255, 0.4);
}

/* Dark mode notifications - Ocean messages */
.dark .notification.success {
    background: rgba(6, 100, 102, 0.95);
    border: 1px solid rgba(10, 251, 255, 0.5);
    color: #adfeff;
    box-shadow: 0 3px 10px rgba(0, 100, 102, 0.2);
}

.dark .notification.error {
    background: rgba(77, 25, 77, 0.95);
    border: 1px solid rgba(195, 70, 195, 0.5);
    color: #ebc1eb;
    box-shadow: 0 3px 10px rgba(77, 25, 77, 0.2);
}

.dark .notification.info {
    background: rgba(20, 69, 82, 0.95);
    border: 1px solid rgba(11, 162, 173, 0.5);
    color: #b2f5fa;
    box-shadow: 0 3px 10px rgba(20, 69, 82, 0.2);
}

.dark .notification.warning {
    background: rgba(49, 34, 68, 0.95);
    border: 1px solid rgba(121, 102, 163, 0.5);
    color: #c8d3e4;
    box-shadow: 0 3px 10px rgba(49, 34, 68, 0.2);
}

/* Dark mode modals and overlays - Deep ocean effects */
.dark .loading-overlay {
    background: rgba(20, 69, 82, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 100, 102, 0.3);
}

.dark .loading-text {
    color: #0afbff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark .spinner-ring {
    border-color: rgba(10, 251, 255, 0.2);
    border-top-color: #0afbff;
}

/* Dark mode game completion styles - Bioluminescent effect */
.dark .celebration {
    box-shadow: 0 0 20px rgba(10, 251, 255, 0.4);
}

/* Dark mode special highlights - Ocean phosphorescence */
.dark .sudoku-cell.highlighted {
    background: linear-gradient(135deg, #0ba2ad 0%, #19e2f0 100%) !important;
    color: #001414 !important;
    border-color: #5cfcff;
    box-shadow: 0 0 12px rgba(92, 252, 255, 0.4);
}

/* Dark mode focus states - Deep sea glow */
.dark input:focus,
.dark textarea:focus {
    border-color: #0afbff;
    box-shadow: 0 0 8px rgba(10, 251, 255, 0.3);
    background: rgba(27, 58, 75, 0.8);
    color: #adfeff;
}

/* Compact Modal Styling */
#success-modal:not(.hidden),
#game-over-modal:not(.hidden) {
    display: flex !important;
}

#success-modal.hidden,
#game-over-modal.hidden {
    display: none !important;
}

/* Modal animations and effects */
#success-modal .animate-celebration {
    animation: celebration 0.6s ease-out;
}

@keyframes celebration {
    0% { 
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    50% { 
        transform: scale(1.05) translateY(-5px);
        opacity: 1;
    }
    100% { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Modal backdrop blur enhancement */
#success-modal,
#game-over-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Enhanced How to Play Section Styles */

/* Keyboard key styling */
kbd {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.dark kbd {
    background: linear-gradient(145deg, #374151, #4b5563);
    border: 1px solid #6b7280;
    color: #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* How to Play card hover animations */
.how-to-play-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.how-to-play-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .how-to-play-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Icon container animations */
.icon-container {
    transition: all 0.3s ease;
}

.how-to-play-card:hover .icon-container {
    transform: rotate(5deg) scale(1.1);
}

/* Gradient text effect for section title */
.gradient-text {
    background: linear-gradient(135deg, #52b69a, #34a0a4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .gradient-text {
    background: linear-gradient(135deg, #0afbff, #52b69a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse animation for the main info icon */
@keyframes pulse-info {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 182, 154, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(52, 182, 154, 0);
    }
}

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

/* Smooth scroll behavior for better UX */
html {
    scroll-behavior: smooth;
}

/* Enhanced responsive design for how to play cards */
@media (max-width: 768px) {
    .how-to-play-card {
        padding: 1rem;
    }
    
    .how-to-play-card h4 {
        font-size: 1rem;
    }
    
    .icon-container {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Modern Sudoku Rules Section Styles */

/* Rule cards hover effects */
.rule-card {
    position: relative;
    overflow: hidden;
}

.rule-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.rule-card:hover::before {
    animation: shimmer 0.6s ease-in-out;
    opacity: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Grid visualization animations */
.rule-card:hover .grid-cols-3 > div {
    animation: ruleGridPulse 0.3s ease-in-out;
}

@keyframes ruleGridPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Gradient text animation */
@keyframes gradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.rule-card h5 {
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
}

/* Enhanced number badges */
.rule-card .font-mono {
    position: relative;
    overflow: hidden;
}

.rule-card .font-mono::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.rule-card:hover .font-mono::before {
    left: 100%;
}

/* Background pattern animation */
@keyframes patternMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(20px);
    }
}

.rule-card:hover ~ .absolute.inset-0 {
    animation: patternMove 2s ease-in-out infinite alternate;
}

/* Pro tip animation */
@keyframes tipGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.6), 0 0 40px rgba(251, 191, 36, 0.3);
    }
}

.rule-card + .mt-8 {
    animation: tipGlow 3s ease-in-out infinite;
}

/* Stagger animation for rule cards */
.rule-card:nth-child(1) {
    animation-delay: 0s;
}

.rule-card:nth-child(2) {
    animation-delay: 0.1s;
}

.rule-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Enhanced responsive design for rules */
@media (max-width: 1024px) {
    .rule-card {
        transform: none !important;
    }
    
    .rule-card:hover {
        transform: translateY(-2px) !important;
    }
}

@media (max-width: 640px) {
    .rule-card .w-24.h-24 {
        width: 4rem;
        height: 4rem;
    }
    
    .rule-card h5 {
        font-size: 1.125rem;
    }
}
