/**
 * Linux BenchTools - Monokai Dark Theme
 * Global CSS variables and base styles
 */

:root {
    /* Monokai Color Palette */
    --bg-primary: #272822;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #232323;
    --bg-hover: #3e3d32;

    --text-primary: #f8f8f2;
    --text-secondary: #75715e;
    --text-muted: #75715e;

    --color-red: #f92672;
    --color-orange: #fd971f;
    --color-yellow: #e6db74;
    --color-green: #a6e22e;
    --color-cyan: #66d9ef;
    --color-blue: #66d9ef;
    --color-purple: #ae81ff;

    /* Semantic Colors */
    --color-success: #a6e22e;
    --color-warning: #e6db74;
    --color-danger: #f92672;
    --color-info: #66d9ef;

    /* Borders */
    --border-color: #3e3d32;
    --border-highlight: #66d9ef;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

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

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    border-radius: var(--radius-md);
}

header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

header h1 i {
    color: var(--color-cyan);
}

nav {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

nav a:hover {
    background: var(--bg-hover);
    color: var(--color-cyan);
}

nav a.active {
    background: var(--color-cyan);
    color: var(--bg-primary);
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    transition: box-shadow var(--transition-normal);
}

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

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-header h2 i {
    color: var(--color-cyan);
}

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

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
}

.detail-grid .full-width {
    grid-column: 1 / -1;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.info-item {
    padding: var(--spacing-sm) 0;
}

.info-item label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.info-item span {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
}

/* Photos Grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .badge {
    position: absolute;
    top: var(--spacing-xs);
    left: var(--spacing-xs);
}

.photo-actions {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: var(--spacing-sm);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.photo-item:hover .photo-actions {
    opacity: 1;
}

/* Document/Link Items */
.document-item,
.link-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-normal);
}

.document-item:hover,
.link-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-highlight);
}

.document-icon,
.link-icon {
    font-size: 2rem;
    color: var(--color-cyan);
    width: 50px;
    text-align: center;
}

.document-info,
.link-info {
    flex: 1;
}

.document-info strong,
.link-info strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.document-info span,
.link-info span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.link-url {
    display: block;
    color: var(--color-cyan);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

.link-url:hover {
    text-decoration: underline;
}

.document-actions,
.link-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* History Timeline */
.history-timeline {
    position: relative;
    padding-left: 2rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.history-item {
    position: relative;
    padding-bottom: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
}

.history-icon {
    position: absolute;
    left: -2rem;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--color-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--color-cyan);
}

.history-content {
    flex: 1;
}

.history-content strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.history-content span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

/* Detail Actions */
.detail-actions {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Code blocks */
code {
    background: var(--bg-tertiary);
    color: var(--color-green);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Selection */
::selection {
    background: var(--color-cyan);
    color: var(--bg-primary);
}
