/* Root variables - Modern Dark Theme */
:root {
    /* Base colors - inspired by DMM */
    --bg-primary: #0f1419;   /* Very dark blue-black background */
    --bg-secondary: #1a1f2e; /* Dark blue-gray cards */
    --bg-tertiary: #232937;  /* Slightly lighter for hover states */
    --text-primary: #e1e8ed; /* Light gray text */
    --text-secondary: #8899a6; /* Muted gray text */
    --text-dim: #5c6f7d;     /* Dimmed text */

    /* Accent colors */
    --accent: #1da1f2;       /* Twitter blue */
    --accent-hover: #1a8cd8; /* Darker blue */
    --accent-light: rgba(29, 161, 242, 0.1); /* Blue with opacity */

    /* Semantic colors */
    --danger: #e1547a;       /* Soft red */
    --danger-hover: #c94062; /* Darker red */
    --danger-bg: #dc3545;    /* Alert background red */
    --danger-border: #bd2130; /* Alert border red */
    --success: #17bf63;      /* Green */
    --warning: #ffad1f;      /* Orange */
    --warning-alt: #ff8c00;  /* Orange for badges */
    --info: #794bc4;         /* Purple */
    --info-alt: #17a2b8;     /* Teal for badges */

    /* UI elements */
    --border: #2f3644;       /* Subtle borders */
    --border-light: rgba(255, 255, 255, 0.1);
    --header-bg: #15202b;    /* Header background */

    /* Design tokens */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --transition-duration: 0.2s;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    --box-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
    --container-width: 1200px;
    --column-gap: 1.5rem;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

    /* Gradient colors */
    --gradient-purple-start: #667eea;
    --gradient-purple-end: #764ba2;
}

/* Light mode variables */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f7f9fa;
        --bg-tertiary: #e1e8ed;
        --text-primary: #14171a;
        --text-secondary: #5b7083;
        --text-dim: #8899a6;
        --header-bg: #f7f9fa;
        --border: #e1e8ed;
        --border-light: rgba(0, 0, 0, 0.1);
        --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
        --box-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
        --accent-light: rgba(29, 161, 242, 0.1);
    }

    body {
        background-image:
            radial-gradient(circle at 20% 80%, rgba(29, 161, 242, 0.03) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(121, 75, 196, 0.03) 0%, transparent 50%);
    }
}

/* Base styles */
html {
    box-sizing: border-box; /* Add global box-sizing */
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

*, *::before, *::after { /* Inherit box-sizing */
    box-sizing: inherit;
}

body {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(29, 161, 242, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(121, 75, 196, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    margin: 0;
    padding: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-wrapper {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .page-wrapper,
    .container {
        max-width: 100%;
    }
}


/* Table styles */
table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    font-size: 0.9375rem;
    border: 1px solid var(--border-light);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-duration) ease;
    max-width: none;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

th {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    border-bottom: 2px solid var(--border);
}

/* Remove gap after table headers */
thead + tbody tr:first-child td {
    padding-top: 0.75rem;
}

tbody tr {
    transition: all 0.2s ease;
}

td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    padding-left: 1rem;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--accent);
    border: 1px solid var(--accent);
    white-space: nowrap;
}

.badge-scanning {
    background: rgba(255, 140, 0, 0.15);
    color: var(--warning-alt);
    border-color: rgba(255, 140, 0, 0.3);
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
}

.badge-info {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info-alt);
    border-color: rgba(23, 162, 184, 0.3);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger-bg);
    border-color: rgba(220, 53, 69, 0.3);
}

/* Stats styles */
.memory-stat, .traffic-stat {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    display: inline-block;
}

/* Traffic information grid */
.traffic-info-container td {
    padding: 1rem;
}

.traffic-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Desktop view - 2 columns for traffic info */
@media (min-width: 769px) {
    .traffic-info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.traffic-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.traffic-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
    font-style: italic;
}

.traffic-startup {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* User info styles */
.user-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: none;
    letter-spacing: normal;
}

/* Plex section styles */
td.plex-section-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plex-info-row td,
.plex-status-row td {
    padding: 0.75rem;
}

.plex-info-grid,
.plex-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: var(--bg-secondary);
    justify-items: start;
}

.plex-info-item,
.plex-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.plex-info-grid .plex-url-item {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.plex-url-item .plex-info-label {
    flex-shrink: 0;
    margin-bottom: 0;
}

.plex-url-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.plex-url-container a {
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.plex-url-container a:hover {
    color: var(--accent-hover);
}

.plex-url-container .button {
    flex-shrink: 0;
}

.plex-info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Plex libraries styles */
.plex-libraries-container td {
    padding: 0.75rem;
}

.plex-libraries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    background: var(--bg-secondary);
}

.plex-library-item {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.plex-library-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(29, 161, 242, 0.1);
}

.plex-library-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.plex-library-title {
    font-weight: 600;
    color: var(--text-primary);
}

.plex-library-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.plex-library-details {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.plex-library-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plex-library-location {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Links inside plex library details */
.plex-library-details a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.plex-library-details a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Moved plex-library-link styles to line 707 */

/* Plex scan button styles */
.plex-scan-button {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.plex-scan-button:hover:not(:disabled) {
    background: var(--bg-secondary);
    color: var(--accent);
    border-color: var(--accent);
}

.plex-scan-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.plex-scan-all-button {
    float: right;
    margin-top: -0.125rem;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: var(--success);
}

.notification-error {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: var(--danger);
}

.notification-info {
    background: rgba(29, 161, 242, 0.1);
    border-color: rgba(29, 161, 242, 0.3);
    color: var(--accent);
}

.notification-warning {
    background: rgba(255, 173, 31, 0.1);
    border-color: rgba(255, 173, 31, 0.3);
    color: var(--warning);
}

.user-info-container td {
    padding: 0.75rem;
}

/* Quick Links styles */
.quick-links-container td {
    padding: 0.75rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quick-link-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.quick-link-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(29, 161, 242, 0.15);
}

.quick-link-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.quick-link-label {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

/* System Resources styles */
.system-resources-container td {
    padding: 0.75rem;
}

.system-resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.resource-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resource-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Sponsor info styles */
.sponsor-info-container td {
    padding: 0.75rem;
}

.sponsor-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.sponsor-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sponsor-link-item:hover {
    border-color: var(--accent);
    background: rgba(29, 161, 242, 0.05);
    box-shadow: 0 2px 8px rgba(29, 161, 242, 0.1);
}

.sponsor-icon {
    font-size: 1.25rem;
}

.sponsor-label {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Library info styles */
.library-info-container td {
    padding: 0.75rem;
}

.library-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.library-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.library-info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.plex-info-grid .library-info-item.plex-url-item {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.plex-url-item .library-info-label {
    flex-shrink: 0;
    margin-bottom: 0;
}

/* Version info styles */
.version-info-container {
    background-color: var(--surface);
}

.version-info-container td {
    padding: 1rem;
}

.version-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
    width: 100%;
}

.version-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0; /* Allow flex items to shrink below content size */
}

.version-item .memory-stat {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}


.version-label,
.traffic-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.user-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.user-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Button styles */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--gradient-purple-start) 0%, var(--gradient-purple-end) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.button:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.button:active {
    opacity: 0.95;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.button-danger {
    background: linear-gradient(135deg, #e1547a 0%, #c94062 100%);
    box-shadow: 0 4px 12px rgba(225, 84, 122, 0.4);
}

.button-danger:hover {
    box-shadow: 0 6px 20px rgba(225, 84, 122, 0.5);
}

.button-secondary {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    box-shadow: none;
}

.button-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.button-primary {
    background: linear-gradient(135deg, #1da1f2 0%, #1a8cd8 100%);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.4);
}

.button-primary:hover {
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.5);
}

.button-small {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 20px;
    min-height: 36px;
}

.button-icon {
    padding: 0.375rem 0.5rem;
    min-width: 0;
    width: auto;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    line-height: 1;
}

.button-inverse {
    background: var(--bg-secondary);
    color: var(--accent);
    border: 2px solid var(--accent);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.15);
}

.button-inverse:hover {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.2);
}

/* Link styles */
a {
    color: var(--accent);
    text-decoration: none;
    transition: all var(--transition-duration) ease;
    font-weight: 500;
    position: relative;
}

a:hover {
    color: var(--accent-hover);
}

a.link-hover {
    position: relative;
    padding-bottom: 2px;
}

a.link-hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

a.link-hover:hover::after {
    width: 100%;
}

/* Remove underline on button hover */
.button:hover, .link-hover:hover {
    text-decoration: none;
}

/* Plex library link - full cell clickable */
.plex-library-link {
    display: block;
    padding: 0.5rem;
    margin: -0.5rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color var(--transition-duration);
}

.plex-library-link:hover {
    background-color: var(--accent-light);
    text-decoration: none;
    border-radius: 4px;
}


/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .support-section {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .support-section form {
        margin: 0;
        display: inline-block;
    }

    .support-text {
        font-size: 0.8125rem;
        flex: 1 1 100%;
        min-width: 0;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .support-section .button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8125rem;
        flex-shrink: 0;
    }

    /* Keep the shutdown button small */
    .support-section form .button.button-small {
        width: auto;
        padding: 0.4rem 0.6rem;
        vertical-align: middle;
    }

    /* Utilities container */
    .utilities-container {
        margin: 0 0 1rem 0;
        padding: 0;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0;
    }

    table, thead, tbody, tr {
        display: block;
    }

    th {
        display: none;
    }

    /* Show section headers */
    th[colspan="3"] {
        display: block;
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        font-weight: 600;
        position: relative;
    }

    tr {
        display: block;
        border: none;
    }

    td {
        display: block;
        border: none;
        padding: 0.75rem;
        position: relative;
        white-space: normal;
        max-width: none;
        overflow: visible;
        word-break: break-word;
    }

    td:not(:last-child) {
        border-bottom: 1px solid var(--border);
    }

    /* Make first column (labels) more prominent */
    td:first-child {
        font-weight: 600;
        position: relative;
        left: 0;
        box-shadow: none;
        padding-left: 1rem;
    }

    /* Handle rowspan cells on mobile */
    td[rowspan] {
        display: block;
        font-weight: 600;
        margin-top: 0.5rem;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .section-header {
        position: relative;
        left: 0;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
}

/* Tablet optimizations */
@media (max-width: 768px) and (min-width: 481px) {
    .version-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .version-item:last-child {
        grid-column: span 2;
        text-align: center;
    }

    .system-resources-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Further mobile optimizations */
@media (max-width: 480px) {
    .memory-stat, .traffic-stat {
        display: inline-block;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .traffic-detail,
    .traffic-startup {
        display: block;
        margin: 0.25rem 0 0 0;
        font-size: 0.6875rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .user-type,
    .premium-days {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Responsive version info grid */
    .version-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: left;
    }

    .version-item {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
    }

    .version-item:last-child {
        border-bottom: none;
    }

    .version-item .memory-stat {
        word-break: break-word;
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .button:hover {
        transform: none;
    }

    .input, .textarea, .select select {
        font-size: 16px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: var(--text-secondary);
}

.text-small {
    font-size: 0.875rem;
}

/* Utilities container styles */
.utilities-container {
    width: 100%;
    max-width: 100%;
    margin: 0 0 1.5rem 0;
    padding: 0;
    overflow: hidden;
}
/* Plex login section */
.plex-login-section {
    text-align: center;
    padding: 20px;
}

.plex-login-message {
    margin-bottom: 10px;
}

.plex-login-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
}

.plex-login-hint {
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Plex login section mobile */
@media (max-width: 768px) {
    .plex-login-section {
        padding: 1rem;
    }

    .plex-login-section .button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .plex-login-section div {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
}

/* Very small screens (phones in portrait) */
@media (max-width: 480px) {
    body {
        padding: 0.25rem;
    }

    .support-section {
        padding: 0.5rem 0.75rem;
        gap: 0.375rem;
        border-radius: var(--border-radius-sm);
    }

    .support-text {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .support-section .button {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-height: 32px;
    }

    .dashboard-layout {
        gap: 0.5rem;
    }

    .dashboard-sidebar,
    .dashboard-main {
        gap: 0.5rem;
    }

    /* Further reduce font size and padding */
    .sidebar-section table,
    .main-section table {
        font-size: 0.75rem;
    }

    .sidebar-section th,
    .sidebar-section td,
    .main-section th,
    .main-section td {
        padding: 0.375rem 0.5rem;
    }

    /* User info on small screens */
    .user-info-grid {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    /* Quick links on small screens */
    .quick-links-grid {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    /* System resources on small screens */
    .system-resources-grid {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    /* Sponsor links on small screens */
    .sponsor-links-grid {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    /* Library info on small screens */
    .library-info-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Version info on small screens */
    .version-info-grid {
        /* Small screen adjustments */
    }

    /* Section headers */
    th[colspan="3"] {
        padding: 0.625rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Simplified Plex URL styles */
.plex-url-simple {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.plex-url-link {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    word-break: break-all;
}

.plex-url-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.plex-auth-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.button-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    font-weight: 500;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.button-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.button-link.danger {
    color: var(--danger);
}

.button-link.danger:hover {
    color: var(--danger-hover);
}

.plex-auth-actions .separator {
    color: var(--text-secondary);
    opacity: 0.5;
    user-select: none;
}

/* Mobile adjustments for simplified Plex URL */
@media (max-width: 768px) {
    .plex-url-simple {
        gap: 0.375rem;
    }

    .plex-url-link {
        font-size: 0.9375rem;
    }

    .plex-auth-actions {
        font-size: 0.8125rem;
    }
}


/* Stuck Scan Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
}

.alert-danger {
    background-color: var(--danger-bg);
    color: white;
    border: 1px solid var(--danger-border);
}

.stuck-scan-alert {
    text-align: left;
}

.stuck-scan-alert strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.stuck-scan-alert p {
    margin: 0.5rem 0;
}

.stuck-alert-reason {
    font-style: italic;
    opacity: 0.9;
    font-size: 0.95rem;
}

.stuck-scan-alert .stuck-alert-action {
    font-weight: 500;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.stuck-alert-actions {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.stuck-alert-actions li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* Activity Status Styles */
.activity-stuck {
    padding: 0.5rem;
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid var(--danger-bg);
    margin-bottom: 0.5rem;
}

.activity-normal {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.stuck-reason {
    color: var(--danger-bg);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    font-style: italic;
}

.stuck-details {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.activity-context {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.activity-context a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.activity-context a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
