/**
 * Main Stylesheet - Unified CSS for all pages
 * Bolsa de Textos / Template
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #888;
    --border-color: #e0e0e0;
    --background: #f7f7f7;
    --white: #ffffff;
    --success: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;

    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-xxl: 40px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);

    /* Fonts */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   LAYOUT - HEADER / NAV
   ======================================== */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

nav {
    background: var(--white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

nav a {
    text-decoration: none;
    margin-right: var(--spacing-lg);
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary-color);
}

nav a:last-child {
    margin-right: 0;
}

nav select {
    padding: var(--spacing-xs);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* ========================================
   LAYOUT - MAIN CONTENT
   ======================================== */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
}

/* ========================================
   LAYOUT - FOOTER
   ======================================== */
footer {
    background: #0e0e0e;
    color: #f5f5f5;
    text-align: center;
    padding: 2.5rem 1rem;
    border-top: 1px solid #222;
    margin-top: var(--spacing-xxl);
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: var(--white);
}

.footer-logo p {
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.footer-socials {
    display: flex;
    gap: 1.2rem;
    font-size: 1.4rem;
}

.footer-socials a {
    color: #ccc;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-socials a:hover {
    color: var(--white);
    transform: scale(1.1);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.footer-links a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    margin-top: 1.5rem;
    border-top: 1px solid #222;
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-lighter);
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        text-align: left;
    }

    .footer-logo {
        max-width: 30%;
    }
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-color);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========================================
   COMPONENTS - BUTTONS
   ======================================== */
button,
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

button:hover,
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   COMPONENTS - FORMS
   ======================================== */
form {
    max-width: 100%;
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid #e1e4e8;
    border-radius: var(--radius-md);
    font-size: 16px;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-family);
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* ========================================
   COMPONENTS - ALERTS
   ======================================== */
.alert {
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    background: var(--success);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.alert-error {
    background: var(--error);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ========================================
   COMPONENTS - TABLES
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

table th {
    background: var(--primary-color);
    color: var(--white);
    padding: var(--spacing-sm);
    text-align: left;
    font-weight: 600;
}

table td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: #f9f9f9;
}

/* ========================================
   COMPONENTS - CARDS
   ======================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: var(--spacing-sm) 0;
}

/* ========================================
   COMPONENTS - GRID
   ======================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   COMPONENTS - BLOG/POST LIST
   ======================================== */
.post-list {
    list-style: none;
}

.post-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.post-item:hover {
    box-shadow: var(--shadow-md);
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.post-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.post-excerpt {
    color: var(--text-color);
    line-height: 1.6;
}

.post-content {
    line-height: 1.8;
    font-size: 1rem;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

/* ========================================
   AUTH PAGES (Login/Register/Reset)
   ======================================== */
.auth-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.auth-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xxl);
    width: 100%;
    max-width: 450px;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-size: 28px;
}

.auth-links {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    main,
    .content {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    nav a {
        margin-right: var(--spacing-sm);
        font-size: 14px;
    }

    table {
        font-size: 14px;
    }

    table th,
    table td {
        padding: var(--spacing-xs);
    }
}
