/* Base styles and variables */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #f47c7c;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --header-bg: #e9ecef;
    --footer-bg: #e9ecef;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    /* Disabled state colors */
    --disabled-bg-light: #4a4a4a;
    --disabled-color-light: #999;
    --disabled-border-light: #777;
    --disabled-bg-dark: #2a2a2a;
    --disabled-color-dark: #777;
    --disabled-border-dark: #555;
}

/* Dark mode variables */
.dark-mode {
    --primary-color: #6d9eeb;
    --secondary-color: #4a8db7;
    --accent-color: #ff8a8a;
    --text-color: #e1e1e1;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    --header-bg: #1a1a1a;
    --footer-bg: #1a1a1a;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header styles */
header {
    background-color: var(--header-bg);
    padding: 2rem 0;
    position: relative;
    transition: var(--transition);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#theme-toggle-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

#theme-toggle-btn:hover {
    background-color: var(--secondary-color);
}

/* Main content styles */
main {
    padding: 2rem 0;
}

.projects-section {
    margin-bottom: 3rem;
}

.projects-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Project card styles */
.project-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.project-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.project-description {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-chip {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
}

.card-button-section {
    width: 100%;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .card-button-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-links {
    display: flex;
    width: 100%;
}

/* Card link styles */
.card-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    text-align: center;
    flex: 1;
    border: none;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

/* Card link hover state - only applies to non-disabled links */
.card-link:not(.disabled):hover {
    background-color: var(--primary-color);
}

/* Button focus state */
.card-link:focus:not(.disabled) {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

/* Disabled card link styles - using higher specificity selectors */
.card-links .card-link.disabled {
    background-color: var(--disabled-bg-light);
    color: var(--disabled-color-light);
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    text-decoration: line-through;
    border: 1px dashed var(--disabled-border-light);
}

/* Ensure disabled attribute works properly with button elements */
.card-links button[disabled] {
    background-color: var(--disabled-bg-light);
    color: var(--disabled-color-light);
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    text-decoration: line-through;
    border: 1px dashed var(--disabled-border-light);
}

/* Dark mode disabled card link styles */
.dark-mode .card-links .card-link.disabled,
.dark-mode .card-links button[disabled] {
    background-color: var(--disabled-bg-dark);
    color: var(--disabled-color-dark);
    border: 1px dashed var(--disabled-border-dark);
}

/* These styles need to come after the disabled styles to ensure proper cascade */
.card-link-left {
    border-bottom-left-radius: var(--border-radius);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.card-link-right {
    border-bottom-right-radius: var(--border-radius);
}

/* Footer styles */
footer {
    background-color: var(--footer-bg);
    padding: 1.5rem 0;
    text-align: center;
    transition: var(--transition);
}

footer p {
    color: var(--text-color);
}

.emoji {
    cursor: help;
}

/* Media queries for responsive design */
@media (min-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    header h1 {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.25rem;
    }
}