/* Common CSS - Shared styles across all pages */

/* CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Common Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-dark: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --gradient-light: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* Base Styles */
body {
    font-family: var(--font-sans);
    background: var(--gradient-primary);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Common Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Common Header Styles */
.header,
.alliance-header {
    background: var(--gradient-dark);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before,
.alliance-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-dark);
    z-index: 1;
}

.header h1,
.alliance-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
    position: relative;
    z-index: 2;
}

.header p,
.alliance-header p {
    font-size: 1.1em;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Enhanced header styling */
.header,
.alliance-header {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Security Error Banner */
.security-error-banner {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    margin: 20px auto;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
}

.security-error-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    position: relative;
}

.security-error-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.security-error-text {
    flex: 1;
    font-size: 1.1em;
    line-height: 1.4;
}

.security-error-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5em;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.security-error-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

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

.header h1,
.alliance-header h1 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.header p,
.alliance-header p {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-weight: 400;
}

/* Common Content Section */
.content {
    padding: 30px;
}

/* Common Section Styling */
.admin-section,
.alliance-info,
.map-info {
    background: white;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-section h3,
.alliance-info h3,
.map-info h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Common Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Common Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-sm.btn-primary {
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-sm.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

/* Common Detail Items */
.map-details,
.alliance-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.map-detail-item,
.alliance-detail-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.map-detail-item label,
.alliance-detail-item label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 5px;
}

.map-detail-item .value,
.alliance-detail-item .value {
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* Common Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid #ccc;
}

.color-swatch.selected {
    border-color: #333;
    transform: scale(1.1);
}

.color-swatch:hover {
    transform: scale(1.05);
}

/* Common Modal Styles */
.modal {
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
    background: var(--gradient-dark);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.close {
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.form-actions {
    margin-top: 20px;
    text-align: right;
}

.form-actions button {
    margin-left: 10px;
}

/* Common Message Styles */
.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Common Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1em;
}

/* Common Navigation Links */
.navigation-links {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.navigation-links a {
    display: inline-block;
    margin: 0 10px;
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.navigation-links a:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.navigation-links a.primary {
    background: var(--gradient-primary);
}

.navigation-links a.primary:hover {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Common Alliance Item Styles */
/*.alliance-admin-item,
.alliance-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}*/

/*.alliance-admin-item:hover,
.alliance-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}*/

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

.alliance-color-display {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.alliance-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.alliance-actions {
    display: flex;
    gap: 10px;
}

/* Common Notice Section */
.notice-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.notice-section h3 {
    color: #856404;
}

.notice-content p {
    color: #856404;
    margin-bottom: 10px;
    line-height: 1.5;
}

.notice-content p:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        margin: 0;
        border-radius: 10px;
    }
    
    .header,
    .alliance-header {
        padding: 20px;
    }
    
    .header h1,
    .alliance-header h1 {
        font-size: 2em;
        letter-spacing: -0.3px;
    }
    
    .header p,
    .alliance-header p {
        font-size: 1em;
    }
    
    .security-error-banner {
        margin: 15px;
        border-radius: 8px;
    }
    
    .security-error-content {
        padding: 15px;
        gap: 10px;
    }
    
    .security-error-text {
        font-size: 1em;
    }
    
    .security-error-dismiss {
        width: 28px;
        height: 28px;
        font-size: 1.3em;
    }
    
    .content {
        padding: 20px;
    }
    
    .admin-section,
    .alliance-info,
    .map-info {
        padding: 20px;
    }
    
    .map-details,
    .alliance-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header,
    .alliance-header {
        padding: 15px;
    }
    
    .header h1,
    .alliance-header h1 {
        font-size: 1.5em;
        letter-spacing: -0.2px;
    }
    
    .header p,
    .alliance-header p {
        font-size: 0.9em;
    }
    
    .security-error-banner {
        margin: 10px;
        border-radius: 6px;
    }
    
    .security-error-content {
        padding: 12px;
        gap: 8px;
        flex-direction: column;
        text-align: center;
    }
    
    .security-error-text {
        font-size: 0.9em;
    }
    
    .security-error-dismiss {
        width: 26px;
        height: 26px;
        font-size: 1.2em;
        align-self: flex-end;
        margin-top: -10px;
    }
    
    .content {
        padding: 15px;
    }
    
    .admin-section,
    .alliance-info,
    .map-info {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}
