/* Custom CSS for TypeFlow */

/* Root variables (optional, but good practice for consistency) */
:root {
    --primary-color: #2563eb; /* blue-600 */
    --secondary-color: #6b7280; /* gray-500 */
    --accent-color: #f59e0b; /* amber-500 */
    --text-color-dark: #1f2937; /* gray-900 */
    --text-color-light: #4b5563; /* gray-700 */
    --bg-light: #f9fafb; /* gray-50 */
    --bg-white: #ffffff;
    --border-color: #e5e7eb; /* gray-200 */
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Link */
.nav-link {
    display: flex;
    align-items: center;
    /* space-x-1 is handled by HTML class */
    padding: 0.5rem 0.75rem; /* py-2 px-3 */
    border-radius: 0.5rem; /* rounded-lg */
    color: #4b5563; /* text-gray-600 */
    transition: background-color 200ms ease-in-out, color 200ms ease-in-out;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
}
.nav-link:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
    color: #2563eb; /* hover:text-blue-600 */
}

/* Active Navigation Link */
.nav-link.active-nav {
    background-color: #e0f2fe; /* light blue background */
    color: #2563eb; /* blue-600 text */
    font-weight: 600; /* font-semibold */
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem; /* py-3 px-6 */
    border: 1px solid transparent;
    font-size: 1rem; /* text-base */
    font-weight: 500; /* font-medium */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    color: #ffffff; /* text-white */
    background-color: #2563eb; /* bg-blue-600 */
    transition: all 200ms ease-in-out;
}
.btn-primary:hover {
    background-color: #1d4ed8; /* hover:bg-blue-700 */
}
.btn-primary:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; /* focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 */
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem; /* py-3 px-6 */
    border: 1px solid #d1d5db; /* border-gray-300 */
    font-size: 1rem; /* text-base */
    font-weight: 500; /* font-medium */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    color: #4b5563; /* text-gray-700 */
    background-color: #ffffff; /* bg-white */
    transition: all 200ms ease-in-out;
}
.btn-secondary:hover {
    background-color: #f9fafb; /* hover:bg-gray-50 */
}
.btn-secondary:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; /* focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 */
}

.btn-sm-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem; /* py-2 px-4 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    border-radius: 0.375rem; /* rounded-md */
    color: #ffffff; /* text-white */
    background-color: #2563eb; /* bg-blue-600 */
    transition: background-color 200ms ease-in-out, color 200ms ease-in-out;
}
.btn-sm-primary:hover {
    background-color: #1d4ed8; /* hover:bg-blue-700 */
}
.btn-sm-primary:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; /* focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 */
}

.btn-sm-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem; /* py-2 px-4 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    border-radius: 0.375rem; /* rounded-md */
    color: #4b5563; /* text-gray-700 */
    background-color: #f3f4f6; /* bg-gray-100 */
    transition: background-color 200ms ease-in-out, color 200ms ease-in-out;
}
.btn-sm-secondary:hover {
    background-color: #e5e7eb; /* hover:bg-gray-200 */
}
.btn-sm-secondary:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; /* focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 */
}


/* Page containers */
.page {
    width: 100%;
    max-width: 80rem; /* max-w-6xl */
    margin-left: auto;
    margin-right: auto;
    transition: opacity 300ms ease-in-out;
}

.page.active {
    display: block;
    opacity: 1;
}

.page.hidden {
    display: none;
    opacity: 0;
}

/* Home Page Animations */
.animated-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s ease-in-out infinite;
}

.circle-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.circle-2 {
    width: 150px;
    height: 150px;
    bottom: 15%;
    right: 10%;
    animation-delay: 3s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    left: 40%;
    transform: translate(-50%, -50%);
    animation-delay: 6s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 30px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Feature Cards on Home Page */
.feature-card {
    background-color: #f9fafb; /* bg-gray-50 */
    padding: 1.5rem; /* p-6 */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 300ms ease-in-out;
}
.feature-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* hover:shadow-md */
    border-color: #93c5fd; /* hover:border-blue-300 */
}

/* Mode Cards on Typing Modes Page */
.mode-card {
    background-color: #ffffff; /* bg-white */
    padding: 2rem; /* p-8 */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 300ms ease-in-out;
}
.mode-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* hover:shadow-xl */
    border-color: #60a5fa; /* hover:border-blue-400 */
}
.mode-card:hover h3 {
    color: #1e40af; /* text-blue-700 */
}

/* Typing Interface Common Styles */
.typing-interface {
    background-color: #ffffff; /* bg-white */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    padding: 1.5rem; /* p-6 */
    width: 100%;
    max-width: 64rem; /* max-w-4xl */
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem; /* mt-8 */
    border: 1px solid #e5e7eb; /* border-gray-200 */
}
@media (min-width: 768px) { /* md:p-8 */
    .typing-interface {
        padding: 2rem;
    }
}

.typing-setup {
    background-color: #ffffff; /* bg-white */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    padding: 1.5rem; /* p-6 */
    width: 100%;
    max-width: 42rem; /* max-w-2xl */
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem; /* mt-8 */
    border: 1px solid #e5e7eb; /* border-gray-200 */
}
@media (min-width: 768px) { /* md:p-8 */
    .typing-setup {
        padding: 2rem;
    }
}

.typing-text-display {
    width: 100%;
    height: 16rem; /* h-64 */
    padding: 1.5rem; /* p-6 */
    border: 1px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 1.25rem; /* text-xl */
    line-height: 1.625; /* leading-relaxed */
    overflow-y: auto;
    outline: none;
    background-color: #f9fafb; /* bg-gray-50 */
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
    word-break: break-word; /* Break long words */
}
.typing-text-display:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6; /* focus:ring-2 focus:ring-blue-500 */
}
@media (min-width: 768px) { /* md:h-80 */
    .typing-text-display {
        height: 20rem;
    }
}


/* Cursor for StealthFlow */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em; /* Adjust to match line height */
    background-color: var(--primary-color);
    animation: blink 1.2s infinite step-end;
    vertical-align: middle; /* Align with text baseline */
    margin-left: 1px;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Text Highlighting for GuidedFlow */
.correct {
    color: #16a34a; /* green-600 */
}

.incorrect {
    color: #dc2626; /* red-600 */
    text-decoration: underline wavy #dc2626;
}

.untyped {
    color: #9ca3af; /* gray-400 */
}

/* Metrics Display */
.metrics-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem; /* gap-4 */
    margin-bottom: 1.5rem; /* mb-6 */
    color: #4b5563; /* text-gray-700 */
    font-weight: 500; /* font-medium */
}

.metric-item {
    background-color: #f3f4f6; /* bg-gray-100 */
    padding: 0.5rem 1rem; /* py-2 px-4 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 1.125rem; /* text-lg */
}

/* Scorecard Modal */
#scorecardContent {
    /* Specific styles for the scorecard content for better image generation */
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 480px; /* Fixed max-width for consistent image size */
    box-sizing: border-box;
}

#scorecardContent .text-5xl {
    font-size: 3.5rem; /* Slightly larger for impact */
}

#scorecardContent .text-2xl {
    font-size: 1.75rem;
}

/* List styles for Help page */
.list-circle {
    list-style-type: circle;
}

/* Global Message/Modal */
#globalMessage {
    transition: opacity 0.3s ease-in-out;
}

#globalMessage.hidden {
    opacity: 0;
    pointer-events: none; /* Allows clicks through when hidden */
}

#globalMessage:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Toggle Switch Styles */
.dot {
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

input:checked + .block {
    background-color: #2563eb; /* blue-600 */
}

input:checked + .block + .dot {
    transform: translateX(1.5rem); /* Move dot to the right */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-link span {
        display: none; /* Hide text on small screens for nav links */
    }
    .nav-link svg {
        margin-right: 0 !important; /* Center icon */
    }
    .typing-text-display {
        height: 200px;
        font-size: 1rem;
    }
    .metrics-display .metric-item {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    #scorecardContent .text-5xl {
        font-size: 2.5rem;
    }
    #scorecardContent .text-2xl {
        font-size: 1.25rem;
    }
}
