* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    color: #ffffff;
    font-family: rudawbold, sans-serif;
    min-height: 100vh;
    padding: 40px; /* Reduced padding */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-content {
    text-align: left;
}

.header h1 {
    font-size: 1.8em; /* Adjusted font size */
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #333;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider .sun-icon, .slider .moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    transition: .4s;
}

.slider .sun-icon {
    left: 6px;
    opacity: 0; /* Hidden in dark mode */
}

.slider .moon-icon {
    right: 6px;
    opacity: 1; /* Visible in dark mode */
}

input:checked + .slider .sun-icon {
    opacity: 1; /* Visible in light mode */
}

input:checked + .slider .moon-icon {
    opacity: 0; /* Hidden in light mode */
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0; /* Adjust the gap between cards as needed */
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px; /* Reduced padding for cards */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-content {
    transition: opacity 0.3s ease;
}

.small-cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.9);
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: row; /* Change to row */
    flex-wrap: wrap;
    justify-content: center; /* Center horizontally */
    align-items: center;
    gap: 12px; /* Reduced gap */
    z-index: 2;
}

.small-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 18px; /* Reduced padding */
    border-radius: 12px; /* Reduced border-radius */
    width: auto; /* Auto width based on content */
    text-align: left; /* Align text left for better readability */
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.small-card:hover {
    transform: translateY(15px) scale(1.05);
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.small-card-icon {
    font-size: 1.3em; /* Reduced font size */
    line-height: 1;
}

.small-card span:last-child {
    font-weight: 400; /* Slightly lighter font weight */
    font-size: 1.1em;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.6em;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2) rotate(90deg);
}

/* Animation for small cards appearing */
.small-cards-container.visible .small-card {
    opacity: 1;
    transform: translateY(0);
    transition-property: opacity, transform;
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    font-size: 3em;
    position: relative;
    z-index: 1;
}

.icon-wrapper {
    width: 100px; /* Reduced icon wrapper size */
    height: 100px; /* Reduced icon wrapper size */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.12);
}

.card-title {
    font-size: 1.6em; /* Reduced font size */
    font-weight: 200;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.card-subtitle {
    color: #888;
    font-size: 1em; /* Reduced font size */
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-top: 20px;
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.top-icons {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

.top-icon {
    font-size: 1.5em;
}

.footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    font-size: 1em;
    color: #888;
    transition: color 0.3s ease;
}

.footer-text:hover {
    color: #fff;
}

/* SVG Icons */
.svg-icon {
    width: 70px; /* Reduced SVG icon size */
    height: 70px; /* Reduced SVG icon size */
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Light Mode Styles */
body.light-mode {
    background: linear-gradient(180deg, #f0f2f5 0%, #e6e9ed 100%);
    color: #333;
}

body.light-mode .language-selector {
    color: #333;
}

body.light-mode .header h1 {
    color: #333; /* Fallback for browsers that don't support background-clip */
}

body.light-mode .card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

body.light-mode .card-subtitle {
    color: #666;
}

body.light-mode .footer-text {
    color: #555;
}

body.light-mode .slider {
    background-color: #ccc;
}

input:checked + .slider {
    background-color: #667eea;
}

/* Light mode modal styles */
body.light-mode .modal-content {
    background: linear-gradient(135deg, #fdfdff 0%, #f5f7fa 100%);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-mode .modal-close-btn {
    color: #555;
}

body.light-mode .modal-title {
    color: #333; /* Fallback for browsers */
}

body.light-mode .app-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .app-item:hover {
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}


/* Global Modal Styles (from pc.html) */
.global-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.global-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.global-modal.visible .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.modal-close-btn:hover {
    transform: scale(1.2) rotate(90deg);
}

.modal-title {
    font-size: 2.2em;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-app-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Explicitly 3 columns for larger screens */
    gap: 20px;
}

.app-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.app-item:hover {
    transform: translateY(-5px);
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.app-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    border-radius: 10px;
    object-fit: contain;
}

.app-name {
    font-size: 1.3em;
    font-weight: 200;
    margin-bottom: 5px;
}

.app-size {
    font-size: 0.9em;
    color: #bbb;
}
.app-download-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background: rgba(102, 126, 234, 0.8);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.app-download-btn:hover {
    background: #667eea;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Ripple Animation */
@keyframes ripple {
    to {
        transform: scale(20);
        opacity: 0;
    }
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .footer-info {
        text-align: center;
    }

    .modal-app-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
}

@media (max-width: 480px) {
    .modal-app-list {
        grid-template-columns: 1fr; /* Single column on small screens */
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-right-wrapper {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

/* About Me Modal Styles */
.about-modal-content {
    text-align: center;
    max-width: 500px; /* Limit width for better readability */
}

.about-profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(102, 126, 234, 0.5);
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.about-title {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-bio {
    color: #bbb;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

.social-media {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-link {
    display: inline-block;
    transition: all 0.3s ease;
    width: 48px; /* Set a fixed width */
    height: 48px; /* Set a fixed height */
    border-radius: 50%; /* Make it circular */
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent; /* Start with a transparent border */
}

.social-link svg {
    width: 32px;
    height: 32px;
    fill: #888;
    transition: fill 0.3s ease, transform 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px);
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.social-link:hover svg {
    fill: #667eea;
}

body.light-mode .about-bio {
    color: #555;
}

body.light-mode .social-link svg {
    fill: #777;
}

body.light-mode .social-link {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .social-link:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.1);
}

/* Language Selector Styles */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-button {
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
}

.language-button:hover {
    background-color: #f0f0f0;
}

body.dark-mode .language-button {
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .language-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.language-button svg {
    stroke: #555;
}

body.dark-mode .language-button svg {
    stroke: #ccc;
}

.language-options {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: rgba(37, 37, 37, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    z-index: 1000;
    width: 160px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.language-options a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #f1f1f1;
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.2s;
}

.language-options a:hover {
    background-color: rgba(102, 126, 234, 0.2);
}

.language-options.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

body.light-mode .language-options {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

body.light-mode .language-options a {
    color: #333;
}

body.light-mode .language-options a:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

  .about-bio {
      font-size: 0.9rem; /* Smaller font size */
      line-height: 1.6;  /* Better line spacing for readability */
      text-align: justify; /* Justify text for a cleaner look */
  }
  .about-note {
      font-size: 0.85rem; /* Even smaller for the note */
  }


.card.dragging {
    transform: scale(1.05); /* Slightly enlarge the card being dragged */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.card.drag-over {
    transform: scale(0.98); /* Slightly shrink cards being hovered over */
}
