/* Global Styles */
:root {
    --primary-color: rgb(23, 43, 221);
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Language Selector Styles */
.language-selector-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.language-selector {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.language-selector:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.language-selector option {
    background-color: var(--primary-color);
    color: white;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: rgb(23, 43, 221); /* Changed header color to purple */
    color: white;
    text-align: center;
    padding: 0rem 1rem;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tool-card {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 280px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.tool-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    margin-bottom: 1.5rem;
    color: #666;
}

/* Color coding for different tools */
.stopwatch i {
    color: #3498db;
}

.countdown i {
    color: #e74c3c;
}

.split-lap i {
    color: #9b59b6;
}

.interval i {
    color: #f39c12;
}

.digital-clock i {
    color: #2ecc71;
}

.alarm i {
    color: #e67e22;
}

.metronome i {
    color: #1abc9c;
}

.chess-clock i {
    color: #34495e;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

footer {
    background-color: rgb(23, 43, 221); /* Changed footer color to match header */
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    transition: var(--transition);
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tools-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .tools-container {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        min-height: 240px;
    }
}

/* Tool-specific pages styling */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tool-display {
    font-size: 4rem;
    text-align: center;
    margin: 2rem 0;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background-color: #2980b9;
}

.control-btn.start {
    background-color: var(--secondary-color);
}

.control-btn.start:hover {
    background-color: #27ae60;
}

.control-btn.stop {
    background-color: var(--accent-color);
}

.control-btn.stop:hover {
    background-color: #c0392b;
}

.fullscreen-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.back-btn {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.back-btn i {
    margin-right: 0.5rem;
}