/* Variables for Enhanced Rails page */
:root {
    --primary: #2e7d32;
    --secondary: #4caf50;
    --accent: #8bc34a;
    --dark: #1b5e20;
    --light: #e8f5e9;
    --text: #333333;
    --code-bg: #f5f5f5;
    --border: #dddddd;
}

/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: #fcfcfc;
    padding-bottom: 2rem;
}

.container {
    width: 85%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Header styles */
.header {
    background-image: url('../enhanced-rails/images/minecart-background.webp');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.header .container {
    position: relative;
    z-index: 2;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--primary);
    margin: 1.5rem 0 1rem;
}

h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.4rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Lists */
ul, ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Code styles */
code, pre {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: var(--code-bg);
    border-radius: 3px;
}

code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
}

pre {
    padding: 1rem;
    margin: 1rem 0 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--border);
}

pre code {
    padding: 0;
    background-color: transparent;
}

.yaml {
    color: #333;
}

.yaml .comment {
    color: #888;
}

/* Component styles */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.alert {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
}

.alert-danger {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
}

.alert-success {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--light);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Button styles */
.btn {
    display: inline-block;
    background-color: var(--secondary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    background-color: var(--dark);
    text-decoration: none;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: #777;
}

/* Utility classes */
.highlight {
    background-color: #ffff9c;
    padding: 0 2px;
}

.section {
    margin: 2.5rem 0;
}

/* Download counter styles */
.download-stats {
    margin-top: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.download-count {
    font-weight: bold;
    color: #FFD700;
}

.card .download-stats {
    color: #555;
    background-color: rgba(0, 0, 0, 0.05);
    margin-top: 15px;
}

.card .download-count {
    color: var(--primary);
}

/* Back to home link */
.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
    color: white;
    transform: translateY(-2px);
}

.back-icon {
    margin-right: 6px;
    font-size: 1.1rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        width: 92%;
    }
    
    .header {
        padding: 2rem 0;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}
