/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #96a6ec 0%, #b789e6 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.site-info {
    text-align: center;
}

.site-name {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(14, 0, 0, 0.3);
}

.site-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.admin-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('<?php echo HERO_IMAGE; ?>');
    background-size: cover;
    background-position: center;
    height: 300px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease;
}

.hero-content {
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* App Card */
.app-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 5px 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    transform: translateY(0);
    animation: cardAppear 0.6s ease-out forwards;
}

.app-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* App Icon - Fixed size and styling */
.app-icon {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 15px;
    margin: 15px auto;
    display: block;
    border: 3px solid #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.app-content {
    padding: 20px;
}

.app-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.app-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* App Store Links - CRITICAL: These must be visible */
.app-store-links {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
    opacity: 1 !important;
    visibility: visible !important;
}

.app-store-btn {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    min-width: 120px;
    color: white;
    opacity: 1 !important;
    visibility: visible !important;
}

.playstore {
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.download {
    background: linear-gradient(45deg, #FF9800, #F57C00);
}

.app-store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* View Details Button */
.view-details {
    display: inline-block;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.5s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1001;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-header {
    padding: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    font-size: 2rem;
    margin: 0;
}

.modal-body {
    padding: 30px;
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    object-fit: cover;
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
    border: 3px solid #667eea;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.screenshot {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

/* Modal Store Links */
#modalStoreLinks {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#modalStoreLinks .app-store-btn {
    margin-bottom: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: 15px;
    margin-top: 50px;
    font-size: 16px;
    line-height: 1.6;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    transition: none !important;
}

.footer p {
    margin: 12px 0;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.footer p:first-child {
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.5px;
}

.footer p:last-child {
    font-style: italic;
    opacity: 0.8;
}

/* Remove any scroll animations that might affect footer */
.footer {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer {
        padding: 30px 15px;
        font-size: 15px;
        margin-top: 40px;
    }
    
    .footer p:first-child {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 25px 10px;
        font-size: 14px;
        margin-top: 30px;
    }
    
    .footer p:first-child {
        font-size: 16px;
    }
    
    .footer p {
        margin: 8px 0;
    }
}

/* Admin Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Admin Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.upload-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upload-form h3 {
    margin-bottom: 20px;
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-full {
    grid-column: 1 / -1;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.apps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.existing-app {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.existing-app h4 {
    margin-bottom: 10px;
    color: #333;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: #ff5252;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .site-info {
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .screenshots {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .app-card {
        margin-bottom: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}