/* Global styles */
:root {
    --primary-color: #4285f4;
    --primary-dark: #3367d6;
    --secondary-color: #34a853;
    --accent-color: #fbbc05;
    --danger-color: #ea4335;
    --light-gray: #f8f9fa;
    --gray: #dadce0;
    --dark-gray: #5f6368;
    --black: #202124;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: var(--black);
    background-color: #fff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main content wrapper to push footer down */
.main-content {
    flex: 1;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 32px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--primary-color);
}

nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
}

nav ul li {
    margin: 0;
}

nav ul:first-child li:first-child {
    margin-left: 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

nav ul li a:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

nav ul li a.active {
    color: var(--primary-color);
}

.nav-btn {
    background-color: var(--primary-color) !important;
    color: white !important;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: var(--primary-dark) !important;
    color: white !important;
}

.nav-btn.active {
    background-color: var(--primary-dark) !important;
    color: white !important;
}

.mobile-menu-icon {
    display: none;
    cursor: pointer;
}

/* Mobile Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--dark-gray);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.mobile-nav-content {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: white;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 80px 0 20px 0;
    overflow-y: auto;
}

.mobile-nav.active .mobile-nav-content {
    right: 0;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.mobile-nav ul li {
    border-bottom: 1px solid var(--light-gray);
}

.mobile-nav ul li a {
    display: block;
    padding: 15px 25px;
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    transition: all 0.3s;
}

.mobile-nav ul li a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.mobile-nav ul li a.nav-btn {
    background-color: var(--primary-color);
    color: white;
    margin: 10px 25px;
    border-radius: 6px;
    text-align: center;
}

.mobile-nav ul li a.nav-btn:hover {
    background-color: var(--primary-dark);
}

.mobile-nav-section {
    border-top: 2px solid var(--light-gray);
    margin-top: 10px;
    padding-top: 10px;
}

.mobile-nav-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        margin-left: auto;
    }
    
    nav {
        display: none;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 10px 0;
    }
    
    .header-content {
        justify-content: space-between;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: rgba(255, 255, 255, 0.9);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--light-gray);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px 0;
}

.card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-image {
    height: 180px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dummy-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border-radius: 8px 8px 0 0;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--black);
}

.card-category {
    display: inline-block;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.card-text {
    color: var(--dark-gray);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--light-gray);
}

.card-developer {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.card-date {
    font-size: 0.8rem;
    color: var(--dark-gray);
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--black);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 1rem;
    min-height: 150px;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: white;
}

.form-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-button {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.form-button:hover {
    background-color: var(--primary-dark);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(52, 168, 83, 0.3);
}

.alert-error {
    background-color: rgba(234, 67, 53, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(234, 67, 53, 0.3);
}

/* App Detail */
.app-detail {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    padding: 40px 0;
}

.app-main-content {
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.app-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background-color: var(--light-gray);
    overflow: hidden;
    flex-shrink: 0;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-title-container {
    flex-grow: 1;
}

.app-category {
    display: inline-block;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.app-title {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--black);
}

.app-developer {
    font-size: 1rem;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

.app-description {
    margin-bottom: 30px;
    line-height: 1.7;
    color: var(--dark-gray);
}

.app-screenshots {
    margin-bottom: 30px;
}

.app-screenshots-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--black);
}

.screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.screenshot {
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
}

.screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-sidebar {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.app-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.app-join-button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: center;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    font-size: 1rem;
    width: 100%;
}

.app-join-button:hover {
    background-color: var(--primary-dark);
}

.app-join-button.joined {
    background-color: var(--secondary-color);
    cursor: default;
}

.app-store-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
    color: white;
    padding: 12px;
    text-align: center;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.3s;
}

.app-store-button:hover {
    opacity: 0.9;
}

.app-store-button img {
    height: 20px;
    margin-right: 10px;
}

.app-info-list {
    margin-top: 25px;
    list-style: none;
}

.app-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--light-gray);
}

.app-info-label {
    color: var(--dark-gray);
}

.app-info-value {
    color: var(--black);
    font-weight: 500;
}

/* Footer */
footer {
    background-color: var(--light-gray);
    color: var(--dark-gray);
    padding: 20px 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.footer-logo {
    margin-bottom: 10px;
}

.footer-logo img {
    height: 24px;
    margin-right: 8px;
}

.footer-about p {
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.footer-column h3 {
    color: var(--black);
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--dark-gray);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--gray);
    font-size: 0.8rem;
}

/* Profile page */
.profile-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--light-gray);
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.profile-name {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.profile-email {
    color: var(--dark-gray);
}

.profile-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--gray);
}

.profile-tab {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.profile-tab:hover:not(.active) {
    color: var(--primary-dark);
    background-color: var(--light-gray);
}

/* FAQ page */
.faq-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray);
    padding-bottom: 20px;
}

.faq-question {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--black);
    cursor: pointer;
}

.faq-answer {
    color: var(--dark-gray);
    line-height: 1.7;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }
    
    .logo {
        margin-right: auto;
    }
    
    nav {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        gap: 10px;
    }
    
    nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    nav ul li {
        margin: 5px 0;
        width: 100%;
        margin-left: 0;
    }
    
    nav ul li a {
        display: block;
        padding: 10px;
        text-align: center;
    }
    
    .app-detail {
        grid-template-columns: 1fr;
    }
    
    .app-sidebar {
        position: static;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero {
        padding: 60px 20px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    /* Profile page mobile responsiveness */
    .profile-tabs {
        flex-direction: column;
        border-bottom: none;
        margin-bottom: 20px;
    }
    
    .profile-tab {
        padding: 12px 15px;
        border-bottom: 1px solid var(--gray);
        text-align: left;
        width: 100%;
        box-sizing: border-box;
    }
    
    .profile-tab.active {
        background-color: var(--primary-color);
        color: white;
        border-bottom: 1px solid var(--primary-color);
    }
    
    .profile-tab:hover:not(.active) {
        background-color: var(--light-gray);
    }
    
    .profile-container {
        padding: 15px;
        margin: 0 10px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .profile-content {
        padding: 15px 0;
    }
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    color: var(--dark-gray);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.tab-content {
    display: block;
}

.tab-content.active {
    display: block;
}

/* Delete Confirmation Modal */
.delete-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.delete-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delete-modal-header {
    background-color: var(--danger-color);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.delete-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.delete-modal-body {
    padding: 25px;
    text-align: center;
}

.delete-modal-body h4 {
    color: var(--black);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.delete-modal-body .app-title {
    background-color: var(--light-gray);
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    margin: 15px 0;
    color: var(--primary-color);
}

.delete-modal-body .warning-list {
    text-align: left;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    font-size: 0.95rem;
}

.delete-modal-body .warning-list ul {
    margin: 0;
    padding-left: 20px;
}

.delete-modal-body .warning-list li {
    margin-bottom: 5px;
    color: #856404;
}

.delete-confirmation-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray);
    border-radius: 6px;
    font-size: 1rem;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
}

.delete-confirmation-input:focus {
    outline: none;
    border-color: var(--danger-color);
}

.delete-confirmation-input.valid {
    border-color: var(--secondary-color);
    background-color: #f0f9f0;
}

.delete-modal-footer {
    padding: 20px 25px;
    text-align: center;
    border-top: 1px solid var(--light-gray);
    display: flex;
    gap: 15px;
    justify-content: center;
}

.delete-modal-footer button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.delete-modal-cancel {
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

.delete-modal-cancel:hover {
    background-color: var(--gray);
}

.delete-modal-confirm {
    background-color: var(--danger-color);
    color: white;
}

.delete-modal-confirm:hover:not(:disabled) {
    background-color: #c82333;
}

.delete-modal-confirm:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.delete-modal-confirm.loading {
    position: relative;
    color: transparent;
}

.delete-modal-confirm.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
