@import url('https://fonts.googleapis.com/css2?family=Anonymous+Pro:wght@400;700&display=swap');
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

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

html, body {
    font-family: 'Anonymous Pro', monospace;
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #0d5e2d;
    color: #ffffff;
}

body, html, #app {
    background-color: #0d5e2d;
    color: #ffffff;
    height: 100%;
}

.page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* Home Page Styling */
.home-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #0d5e2d;
    width: 100%;
    gap: 24px;
}

.start-button {
    padding: 16px 42px;
    font-size: 18px;
    background-color: #ffffff;
    color: #0d5e2d;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Anonymous Pro', monospace;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.home-logo {
    width: clamp(120px, 25vw, 240px);
    height: clamp(120px, 25vw, 240px);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.start-button:hover {
    background-color: #e6e6e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.start-button:active {
    transform: translateY(0);
}

/* Timer Page Styling */
.timer-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #0d5e2d;
    gap: 32px;
    position: relative;
    width: 100%;
    padding: 20px;
}

.timer-display {
    font-size: clamp(100px, 22vw, 280px);
    font-weight: 700;
    font-family: 'Anonymous Pro', monospace;
    color: #ffffff;
    letter-spacing: 4px;
    text-align: center;
    line-height: 1;
}

.timer-blinds-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 800px;
}

.blind-display {
    font-size: clamp(28px, 8vw, 80px);
    font-weight: 600;
    font-family: 'Anonymous Pro', monospace;
    color: #ffffff;
    text-align: center;
    flex: 0 1 auto;
    min-width: 100px;
}

.blind-label {
    font-size: clamp(10px, 2vw, 14px);
    color: #b3d9b3;
    margin-top: 6px;
    opacity: 0.8;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.blind-display-large {
    font-size: clamp(60px, 13.2vw, 168px);
    font-weight: 700;
    font-family: 'Anonymous Pro', monospace;
    color: #ffffcc;
    text-align: center;
    letter-spacing: 2px;
}

.round-number-display {
    font-size: clamp(18px, 4vw, 52px);
    font-weight: 600;
    font-family: 'Anonymous Pro', monospace;
    color: #b3d9b3;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.control-button {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    border: 2px solid #ffffff;
    background-color: transparent;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-weight: 600;
}

.control-button:hover:not(:disabled) {
    background-color: #ffffff;
    color: #0d5e2d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.control-button:active:not(:disabled) {
    transform: translateY(0);
}

.control-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #4a7c5e;
    color: #4a7c5e;
}

.nav-button {
    width: 60px;
    height: 60px;
    font-size: 24px;
    border-color: #b3d9b3;
    color: #b3d9b3;
}

.nav-button:hover:not(:disabled) {
    background-color: #b3d9b3;
    border-color: #b3d9b3;
    color: #0d5e2d;
    box-shadow: 0 4px 12px rgba(179, 217, 179, 0.2);
    transform: translateY(-2px);
}

.icon {
    display: inline-block;
}

.settings-icon {
    background-color: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    border-radius: 4px;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-weight: 600;
    flex-shrink: 0;
}

.settings-icon:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #0d5e2d;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.settings-icon:active {
    transform: translateY(0);
}

.top-right-buttons {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-left-logo {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.1));
}

.start-new-game-button {
    height: 48px;
    padding: 0 16px;
    font-size: 12px;
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Anonymous Pro', monospace;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-new-game-button:hover {
    background-color: #ffffff;
    color: #0d5e2d;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.start-new-game-button:active {
    transform: translateY(0);
}


/* Game Settings Page Styling */
.settings-container {
    background-color: #0d5e2d;
    color: #ffffff;
    min-height: 100vh;
    padding: 40px 20px;
    font-family: 'Anonymous Pro', monospace;
}

.settings-container h1 {
    text-align: center;
    color: #ffffff;
    font-size: 28px;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.settings-container h2 {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 600;
}

.rounds-list {
    max-width: 900px;
    margin: 0 auto;
}

.round-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a7a42;
    border: 1px solid #0d5e2d;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.round-item:hover {
    background-color: #22924f;
    border-color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.round-info {
    flex: 1;
}

.round-number {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.round-details {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #b3d9b3;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 9px;
    color: #b3d9b3;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 20px;
    color: #ffffff;
    font-weight: 700;
}

.round-details span {
    background-color: #0d5e2d;
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid #1a7a42;
    font-weight: 500;
}

.round-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-left: 40px;
}

.action-button {
    width: 32px;
    height: 32px;
    border: 1px solid #4a7c5e;
    background-color: transparent;
    color: #b3d9b3;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-button:hover:not(:disabled) {
    background-color: #1a7a42;
    border-color: #b3d9b3;
    color: #ffffff;
}

.action-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.action-button.edit-btn {
    border-color: #66b3ff;
    color: #66b3ff;
}

.action-button.edit-btn:hover:not(:disabled) {
    background-color: #0d3d66;
    border-color: #99ccff;
    color: #99ccff;
}

.action-button.delete-btn {
    border-color: #ff9999;
    color: #ff9999;
}

.action-button.delete-btn:hover:not(:disabled) {
    background-color: #660000;
    border-color: #ffcccc;
    color: #ffcccc;
}

.no-rounds {
    text-align: center;
    color: #b3d9b3;
    font-size: 15px;
    padding: 24px;
}

.add-round-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 24px;
    background-color: #ffffff;
    color: #0d5e2d;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Anonymous Pro', monospace;
    letter-spacing: 0.3px;
}

.add-round-button:hover {
    background-color: #e6e6e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.add-round-button:active {
    transform: translateY(0);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #1a7a42;
    border: 1px solid #0d5e2d;
    border-radius: 4px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #ffffff;
    font-size: 18px;
}

.modal-content p {
    margin: 0 0 24px 0;
    color: #b3d9b3;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #b3d9b3;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #0d5e2d;
    border-radius: 4px;
    background-color: #0d5e2d;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Anonymous Pro', monospace;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    background-color: #0d5e2d;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-error {
    color: #ff9999;
    margin-bottom: 20px;
    font-weight: 500;
    min-height: 20px;
    font-size: 13px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.save-button {
    flex: 1;
    padding: 10px;
    background-color: #ffffff;
    color: #0d5e2d;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Anonymous Pro', monospace;
    letter-spacing: 0.3px;
}

.save-button:hover {
    background-color: #e6e6e6;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.save-button:active {
    transform: translateY(0);
}

.cancel-button {
    flex: 1;
    padding: 10px;
    background-color: transparent;
    color: #b3d9b3;
    border: 1px solid #4a7c5e;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Anonymous Pro', monospace;
    letter-spacing: 0.3px;
}

.cancel-button:hover {
    background-color: #1a7a42;
    border-color: #ffffff;
    color: #ffffff;
}

.cancel-button:active {
    transform: translateY(0);
}

.settings-footer {
    margin-top: 40px;
    text-align: center;
}

.save-all-button {
    padding: 12px 36px;
    background-color: #ffffff;
    color: #0d5e2d;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Anonymous Pro', monospace;
    letter-spacing: 0.3px;
}

.save-all-button:hover {
    background-color: #e6e6e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.save-all-button:active {
    transform: translateY(0);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #ffffff;
}

.btn-primary {
    color: #0d5e2d;
    background-color: #ffffff;
    border-color: #b3d9b3;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #ffffff;
}

.invalid {
    outline: 1px solid #ff9999;
}

.validation-message {
    color: #ff9999;
}

#blazor-error-ui {
    background: #660000;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #ffcccc;
    border-top: 1px solid #ff9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #660000;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffcccc;
    border: 1px solid #ff9999;
    border-radius: 4px;
    margin: 1rem 0;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* PIN Entry Component Styling */
.pin-entry-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.pin-entry-container h2 {
    font-size: 16px;
    color: #b3d9b3;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.pin-boxes {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.pin-box {
    width: 50px;
    height: 50px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #ffffff;
    border-radius: 4px;
    background-color: transparent;
    color: #ffffff;
    font-family: 'Anonymous Pro', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0;
}

.pin-box::placeholder {
    color: transparent;
}

.pin-box::-webkit-outer-spin-button,
.pin-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-box[type=number] {
    -moz-appearance: textfield;
}

.pin-box:focus {
    outline: none;
    border-color: #b3d9b3;
    background-color: #0d5e2d;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.pin-error {
    color: #ff9999;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    letter-spacing: 0.3px;
}

.start-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #4a7c5e;
    border-color: #4a7c5e;
}

.start-button:disabled:hover {
    background-color: #4a7c5e;
    transform: none;
    box-shadow: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* Timer Page Mobile Adjustments */
    .timer-container {
        gap: 24px;
        padding: 16px;
        justify-content: flex-start;
        padding-top: 90px;
    }

    .timer-display {
        font-size: clamp(48px, 15vw, 120px);
        margin-top: 20px;
    }

    .timer-blinds-row {
        gap: 24px;
        max-width: 100%;
        flex-direction: column;
    }

    .blind-display {
        font-size: clamp(18px, 6vw, 50px);
        min-width: 70px;
    }

    .blind-label {
        font-size: clamp(8px, 2vw, 12px);
    }

    .timer-controls {
        gap: 12px;
        flex-wrap: wrap;
    }

    .control-button {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .nav-button {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    /* Top Right Buttons Mobile */
    .top-right-buttons {
        top: 12px;
        right: 12px;
        gap: 8px;
        flex-direction: column;
        align-items: flex-end;
    }

    .settings-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .start-new-game-button {
        height: 40px;
        padding: 0 12px;
        font-size: 11px;
        white-space: wrap;
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    /* Extra small phones */
    .timer-container {
        gap: 16px;
        padding: 12px;
        padding-top: 80px;
    }

    .timer-display {
        font-size: clamp(40px, 12vw, 100px);
        margin-top: 15px;
        letter-spacing: 2px;
    }

    .timer-blinds-row {
        gap: 16px;
        flex-direction: column;
        justify-content: center;
    }

    .blind-display {
        font-size: clamp(14px, 5vw, 40px);
        min-width: 60px;
    }

    .blind-label {
        font-size: clamp(7px, 1.5vw, 10px);
        margin-top: 4px;
    }

    .timer-controls {
        gap: 8px;
    }

    .control-button {
        width: 52px;
        height: 52px;
        font-size: 20px;
        border-width: 1.5px;
    }

    .nav-button {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .top-right-buttons {
        top: 8px;
        right: 8px;
        gap: 6px;
    }

    .settings-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-width: 1.5px;
    }

    .start-new-game-button {
        height: 36px;
        padding: 0 10px;
        font-size: 10px;
        border-width: 1.5px;
    }
}

/* iPad and larger tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .timer-container {
        gap: 28px;
    }

    .control-button {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .nav-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}
