:root {
    --primary-color: #ffcc00;
    --secondary-color: #ff6600;
    --text-color: #ffffff;
    --background-dark: rgba(0, 0, 0, 0.8);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #1a0f3c 100%);
    font-family: 'Minecraft', Arial, sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
}

#tsparticles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background: radial-gradient(circle at center, rgba(26, 15, 60, 0.5) 0%, rgba(0, 0, 0, 0.8) 100%);
    overflow: hidden;
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    overflow: hidden;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Particle Animation */
@keyframes particleUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.floating-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Common Button Styles */
.btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #000;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 0 10px var(--primary-color);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--primary-color);
}

/* Card Styles */
.card {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-10px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-container {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message Containers */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-container.success {
    background-color: #4caf50;
}

.message-container.error {
    background-color: #f44336;
}

.message-container i {
    font-size: 18px;
}

.message-container.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Floating Particles */
.floating-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #ffcc00, #ff6600);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

@keyframes particleUp {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Back Button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    color: white;
    margin: 0;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #999;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.save-button {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.save-button:active {
    transform: translateY(0);
}

/* Form Container Blur Effect */
.form-container {
    transition: filter 0.3s ease-in-out;
}

.form-container.blur {
    filter: blur(5px);
}

/* Button Loading State */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn.loading {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 1.5s ease-in-out infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Form Styles */
.form-container {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    width: calc(100% - 4rem);  /* Account for padding */
    max-width: 400px;
    margin: 2rem auto;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;  /* Include padding in width calculation */
}

.form-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 17px;
    z-index: -1;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.form-container:hover::before {
    opacity: 0.2;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;  /* Include padding in width calculation */
}

.form-group input {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;  /* Include padding in width calculation */
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    outline: none;
}

.form-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

/* Success and Error Messages */
.success-message,
.error-message {
    padding: 10px;
    margin-bottom: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.success-message {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #28a745;
}

.error-message {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #dc3545;
}

/* Google Sign In Container */
.google-signin-container {
    width: 100%;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;  /* Include padding in width calculation */
}

.divider {
    width: 100%;
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    box-sizing: border-box;  /* Include padding in width calculation */
}

.divider span {
    background: rgba(0, 0, 0, 0.7);
    padding: 0 1rem;
    color: #ccc;
    position: relative;
    z-index: 1;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Fix for Google Sign In button */
.g_id_signin {
    width: 100% !important;
    box-sizing: border-box !important;
}

.g_id_signin > div {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .form-container {
        width: calc(100% - 2rem);  /* Smaller padding on mobile */
        margin: 1rem;
        padding: 1.5rem;
    }

    .form-group input {
        font-size: 14px;  /* Slightly smaller font on mobile */
        padding: 10px 35px;  /* Slightly reduced padding */
    }
} 

/* Enhanced mobile responsiveness */
@media (max-width: 576px) {
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    .container {
        padding: 1rem 0.5rem;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Fix right side shift */
    .items, .vote-container, .coins-container, .ranks-container, .profile-container {
        padding: 0.5rem;
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    /* Keep profile/login buttons visible but smaller */
    .profile-button, .login-button {
        padding: 8px 16px;
        font-size: 14px;
        top: 10px;
        right: 10px;
    }
    
    /* Smaller headings */
    .page-title {
        font-size: 1.8rem;
        text-align: center;
        margin: 2rem 0;
    }
    
    /* Ensure cards don't overflow */
    .item, .vote-item, .coin-card, .rank-card {
        width: 100%;
        margin: 0.5rem 0;
        padding: 1.5rem 1rem;
        box-sizing: border-box;
    }
    
    /* Fix logo size for mobile */
    .logo img {
        width: 100%;
        max-width: 300px;
    }
    
    /* Fix form elements */
    .form-group {
        width: 100%;
    }
    
    /* Center modals better */
    .modal-content {
        width: 90%;
        margin: 20% auto;
        padding: 1.5rem;
    }
    
    /* Ensure back button is accessible */
    .back-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Responsive styles for all pages */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
}

/* Tablet styles */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1rem 0.5rem;
    }
    
    .grid, .items, .ranks-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .modal-content {
        width: 95% !important;
        max-width: 500px !important;
        padding: 20px !important;
    }
    
    .form-control, .btn {
        padding: 10px !important;
    }
    
    .profile-button, .login-button, .back-button {
        padding: 10px 16px !important;
    }
}

/* Mobile styles */
@media (max-width: 576px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 1rem 0.5rem;
        width: 100%;
    }
    
    .grid, .items, .ranks-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 !important;
        width: 95% !important;
        margin: 1rem auto !important;
    }
    
    .card, .item, .rank-card {
        padding: 1rem !important;
    }
    
    .logo img {
        width: 90% !important;
        max-width: 300px !important;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.2rem !important;
    }
    
    .profile-button, .login-button, .back-button {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }
    
    .form-group {
        margin-bottom: 0.5rem !important;
    }
    
    .form-control, .btn {
        padding: 8px !important;
        font-size: 0.9rem !important;
    }
    
    .modal-content {
        width: 95% !important;
        padding: 15px !important;
        margin: 20% auto !important;
    }
    
    .team-button, .btn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        margin-top: 0.8rem !important;
    }
    
    /* Fix flex layouts on mobile */
    .flex-row {
        flex-direction: column !important;
    }
    
    /* Fix tables on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Make sure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Improved mobile buttons */
@media (max-width: 768px) {
    .btn, .login-btn, .register-btn, .back-button {
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
    }
    
    .profile-button, .login-button, .back-button {
        padding: 8px 14px !important;
        border-radius: 8px !important;
    }
    
    .team-button, .btn {
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 576px) {
    .btn, .login-btn, .register-btn, .back-button {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }
    
    .profile-button, .login-button, .back-button {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
        border-radius: 6px !important;
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.3) !important;
    }
    
    .team-button, .btn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        margin-top: 0.8rem !important;
    }
    
    .see-details-btn {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
        margin: 5px 0 !important;
    }
    
    .buy-rank {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
    
    /* Ensure touch targets are still accessible */
    .btn, button, a[role="button"] {
        min-height: 36px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}