* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

.content-wrapper {
    flex: 1;
    padding-bottom: 2rem;
}

/* Header Styles */
.header {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
}

.cursor {
    animation: blink 0.75s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.about-link {
    text-decoration: none;
    color: inherit;
    font-size: 1.1rem;
    position: relative;
}

.about-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s;
}

.about-link:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: inherit;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

/* Title Styles */
.subtitle-container {
    margin-top: 2rem;
}

.title-group {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.sub-text {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    letter-spacing: -0.02em;
}

.dark-mode .sub-text {
    color: #aaa;
}

/* Stats Section Styles */
.stats-section {
    max-width: 1200px;
    margin: 1rem auto 0.5rem; 
    padding: 0 1.5rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.projects-section {
    max-width: 1200px;
    margin: 0.5rem auto;
    padding: 0 1.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(130, 130, 130, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
}

.dark-mode .project-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .project-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.project-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    flex-shrink: 0;
}

.project-icon i {
    font-size: 1.25rem;
    color: #3b82f6;
}

.project-info {
    flex: 1;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.dark-mode .project-title {
    color: #e2e8f0;
}

.project-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.dark-mode .project-description {
    color: #a0aec0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 0.75rem;
    }

    .project-card {
        padding: 1rem;
    }

    .project-icon {
        width: 32px;
        height: 32px;
    }

    .project-icon i {
        font-size: 1rem;
    }

    .project-title {
        font-size: 1rem;
    }

    .project-description {
        font-size: 0.85rem;
    }
}

.visitor-count {
    font-size: 1.875rem;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.visitor-text {
    color: #4b5563;
}

.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.dark-mode .visitor-text {
    color: #aaa;
}

.semaphore-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: grey; /* Default color */
    transition: background-color 0.5s ease; /* Smooth transition */
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.red {
    background-color: red;
}

.yellow {
    background-color: yellow;
}

.green {
    background-color: green;
}

.semaphore-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.semaphore-status-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.semaphore-status {
    font-size: 0.9rem;
    margin: 0;
    font-weight: 600;
}

.semaphore-time {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    text-align: center;
}

.dark-mode .semaphore-time {
    color: #aaa;
}

.stats-box {
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark-mode .stats-box {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.stats-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #1f2937;
}

.dark-mode .stats-title {
    color: #ccc;
}

.stats-content {
    min-height: 70px;
}

/* Footer Styles */
.footer {
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background-color: #ffffff;
    width: 100%;
    z-index: 10;
}

.dark-mode .footer {
    border-color: #333;
    background-color: #1a1a1a;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left, .footer-right {
    font-size: 0.9rem;
    color: #666;
    transition: color 0.3s;
}

.dark-mode .footer-left,
.dark-mode .footer-right {
    color: #888;
}

.heart-icon {
    color: #ff4d4d;
    animation: heartbeat 1.5s ease infinite;
    display: inline-block;
    margin: 0 0.25rem;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .stats-box {
        min-height: 80px;
        padding: 0.75rem;
    }

    .stats-title {
        font-size: 1rem;
    }
    
    .visitor-text, .semaphore-time {
        font-size: 0.8rem;
    }
    
    .title-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .sub-text {
        font-size: 1rem;
    }

    .stats-section {
        margin: 0.75rem auto 0.25rem;
    }
    
    .projects-section {
        margin: 0.25rem auto;
    }
}

.dynamic-island {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    border-radius: 60px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                background 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.dynamic-island:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dark-mode .dynamic-island {
    background: rgba(23, 23, 23, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 2px 4px -1px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dark-mode .dynamic-island:hover {
    background: rgba(32, 32, 32, 0.95);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.2),
        0 10px 10px -5px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dynamic-island-content {
    position: fixed;
    top: 100px;
    right: 90px; /* Position to the left of the island */
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transform: translateX(20px) scale(0.95);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    width: 200px; /* Fixed width for the content */
    max-width: 90vw; /* Make sure it doesn't overflow on small screens */
}

.dynamic-island-content.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.dark-mode .dynamic-island-content {
    background: rgba(23, 23, 23, 0.95);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dynamic-island-content ul {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.dynamic-island-content ul li {
    padding: 12px 20px;
    margin: 4px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 14px;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dynamic-island-content ul li:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.dark-mode .dynamic-island-content ul li:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.dynamic-island-content ul li:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .dynamic-island-content ul li:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dynamic-island-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    color: #3b82f6;
    transition: transform 0.2s ease;
}

.dynamic-island:hover .dynamic-island-icon {
    transform: scale(1.1);
}