:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #2980b9;
    --text: #333;
    --text-light: #7f8c8d;
    --bg: #f8f9fa;
    --card-bg: #fff;
    --border: #e0e0e0;
    --success: #27ae60;
    --error: #e74c3c;
    --heading: #2c3e50;
}

body.dark {
    --primary: #34495e;
    --secondary: #2980b9;
    --accent: #3498db;
    --text: #ecf0f1;
    --text-light: #bdc3c7;
    --bg: #1a1a1a;
    --card-bg: #252525;
    --border: #3d3d3d;
    --success: #2ecc71;
    --error: #e74c3c;
    --heading: #f8f9fa;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Header Styles */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

.header-info {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-light);
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #3498db, #9b59b6, #e74c3c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading);
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px;
}

/* Grid Layout */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* App Cards */
.app-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--secondary);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--secondary);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text);
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--secondary);
}

/* Form Elements */
input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

button {
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

button:hover {
    background-color: var(--accent);
    transform: translateY(-1px);
}

button.secondary {
    background-color: transparent;
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

button.secondary:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Utility Classes */
.text-muted {
    color: var(--text-light);
    font-size: 0.9rem;
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* Specific App Styling */
.clock-display {
    font-family: 'Fira Code', monospace;
    font-size: 1.75rem;
    letter-spacing: 1px;
    color: var(--secondary);
    font-weight: 500;
}

.color-preview {
    width: 100%;
    height: 80px;
    border-radius: 4px;
    margin: 1rem 0;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.task-item:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

table tr:last-child td {
    border-bottom: none;
}

/* Password Toggle Container */
.password-container {
    position: relative;
    margin-bottom: 1rem;
}

.password-container input {
    padding-right: 70px;
    margin-bottom: 0;
}

.password-container button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    border-radius: 0 4px 4px 0;
}

/* Light Bulb */
.colourbutton {
    transition: all 0.3s ease;
}

.colourbutton:hover {
    transform: scale(1.05);
}

/* Calculator */
.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.calculator input {
    grid-column: span 4;
    text-align: right;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.calculator button {
    padding: 0.75rem;
}

.calculator .span-2 {
    grid-column: span 2;
}
