/* 6CIT Cognitive Test - Shared Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #222;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    text-shadow: none;
}

h2 {
    font-size: 2rem;
    color: #333;
}

h3 {
    font-size: 1.5rem;
    color: #444;
}

p {
    margin-bottom: 1rem;
    color: #333;
}

/* Link Styles */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Button Base Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    user-select: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button Variants */
.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    color: white;
}

.btn-warning:hover {
    color: #212529;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

/* Navigation Styles */
nav {
    background: #fff;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007bff;
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav .nav-links a {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

nav .nav-links a:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* Select Styles */
select.form-control {
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

/* Checkbox and Radio Styles */
.form-check {
    position: relative;
    display: block;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.form-check-input {
    position: absolute;
    top: 0.25rem;
    left: 0;
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.form-check-label {
    padding-left: 0.5rem;
    cursor: pointer;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Progress Styles */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: white;
    text-align: center;
    white-space: nowrap;
    background-color: #007bff;
    transition: width 0.6s ease;
}

/* Step indicator and timer styles for larger text */
.step-indicator {
    flex: 1;
    text-align: center;
    font-weight: 500;
    font-size: 1.35rem; /* Increased from 1rem */
    color: #666;
}

.step-timer {
    font-size: 1.5rem; /* Increased from 1.1rem */
    color: #007bff;
    font-weight: bold;
    margin-top: 5px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* --- iPad/iPhone Drawing Canvas DPI Fix (for all canvases) --- */
canvas, .drawing-area, #clockCanvas, #practiceCanvas {
    image-rendering: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 100vw;
    max-height: 60vh;
    display: block;
    margin: 0 auto 20px auto;
}

/* Prevent iOS Safari from zooming on input focus */
input, select, textarea {
    font-size: 16px !important;
}

/* Ensure minimum touch target for buttons and controls */
button, .btn, .tool-btn, select, input[type="radio"], input[type="checkbox"] {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    nav .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    nav .nav-links a {
        padding: 0.75rem 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid;
    }
    
    .card {
        border: 2px solid #333;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .btn, nav {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
