:root {
    --header-bg: #232B37; /* Darker, cooler navy */
    --header-text: #ffffff;
    --bg-color: #f7f9fc; /* Very light blue-grey */
    --widget-bg: #ffffff;
    --text-color: #2d3748; /* Dark grey */
    --link-color: #232B37; /* Modern blue */
    --border-color: #e2e8f0;
    --hover-bg: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 15px; /* Slightly larger base size */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
}

/* Header Styles */
.aws-header {
    position: sticky;
    top: 0;
    background-color: var(--header-bg);
    color: var(--header-text);
    height: 56px; /* Taller header */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.logo-container:hover {
    background-color: var(--hover-bg);
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    position: relative;
}

/* Fencode Logo Text */
.fa-fencode {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-transform: uppercase;
    font-style: normal;
    line-height: 1;
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, #ed8936 0%, #f6ad55 50%, #ed8936 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    text-shadow: 0 2px 8px rgba(237, 137, 54, 0.3);
}

.fa-fencode::before {
    content: "Fencode";
    display: inline-block;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Curved Arrow Under Logo */
.logo-arrow {
    width: 100px;
    height: 12px;
    margin-top: -2px;
    margin-left: 0;
    stroke: #ed8936;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .fa-fencode {
        color: #ed8936;
        background: none;
        -webkit-text-fill-color: #ed8936;
    }
}

.nav-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    padding: 8px 12px;
    height: auto;
    color: #e2e8f0;
    border-radius: var(--radius-md);
    transition: background-color 0.2s, color 0.2s;
}

.nav-item:hover {
    background-color: var(--hover-bg);
    color: #fff;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 24px;
}

.search-bar {
    background-color: #fdfdfd; /* Darker shade */
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 12px;
    height: 36px;
    transition: all 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--link-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.search-bar:focus-within i {
    color: #4a5568;
}

.search-bar:focus-within input {
    color: #2d3748;
}

.search-bar i {
    color: #a0aec0;
    margin-right: 10px;
    font-size: 14px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    background: transparent;
    color: #ffffff;
}

.search-bar input::placeholder {
    color: #a0aec0;
}

/* Search Autocomplete */
.header-center {
    position: relative;
}

.search-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-width: 600px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1001;
    max-height: 500px;
    overflow-y: auto;
    display: none;
}

.search-autocomplete-content {
    padding: 8px 0;
}

.search-autocomplete-group {
    margin-bottom: 8px;
}

.search-autocomplete-group:last-of-type {
    margin-bottom: 0;
}

.search-autocomplete-group-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.search-autocomplete-items {
    display: flex;
    flex-direction: column;
}

.search-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #2d3748;
    text-decoration: none;
    transition: background-color 0.15s;
    cursor: pointer;
}

.search-autocomplete-item:hover,
.search-autocomplete-item.selected {
    background-color: #f7fafc;
}

.search-autocomplete-footer {
    border-top: 1px solid #e2e8f0;
    padding: 8px 0;
    margin-top: 8px;
}

.search-autocomplete-view-all {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #232B37;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.15s;
}

.search-autocomplete-view-all:hover {
    background-color: #f7fafc;
}

/* Search Autocomplete Scrollbar */
.search-autocomplete::-webkit-scrollbar {
    width: 8px;
}

.search-autocomplete::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 4px;
}

.search-autocomplete::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.search-autocomplete::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Search Autocomplete */
.search-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
}

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

.search-autocomplete-item:hover {
    background-color: #f9fafb;
}

.search-autocomplete-item.active {
    background-color: #ebf8ff;
}

.search-autocomplete-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.search-autocomplete-item-icon.s3 {
    background-color: #c6f6d5;
    color: #22543d;
}

.search-autocomplete-item-icon.media_library {
    background-color: #bee3f8;
    color: #2c5282;
}

.search-autocomplete-item-icon.drm {
    background-color: #e9d8fd;
    color: #553c9a;
}

.search-autocomplete-item-icon.collection {
    background-color: #fed7aa;
    color: #c05621;
}

.search-autocomplete-item-icon.video {
    background-color: #bee3f8;
    color: #2c5282;
}

.search-autocomplete-item-content {
    flex: 1;
    min-width: 0;
}

.search-autocomplete-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-autocomplete-item-subtitle {
    font-size: 12px;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-autocomplete-empty {
    padding: 24px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.search-autocomplete-loading {
    padding: 24px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.search-autocomplete-loading i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Main Content */
.main-container {
    flex: 1;
    display: flex;
    /* padding: 20px;  Removed padding from container to let sidebar stretch */
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    align-self: flex-start;
}

.sidebar-group {
    padding-bottom: 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-item:hover {
    background-color: #edf2f7;
    color: #1a202c;
}

.sidebar-item.active {
    border-left: none; /* Remove old border */
    background-color: #ebf8ff;
    color: #232B37;
    font-weight: 600;
}

.sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 12px 0;
}

.sidebar-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content-wrapper {
    flex: 1;
    padding: 32px;
    max-width: 100%;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: -0.02em;
}

.btn-customize {
    background-color: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: var(--radius-md);
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-customize:hover {
    background-color: #f7fafc;
    border-color: #a0aec0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
}

.widget {
    background-color: var(--widget-bg);
    border: 1px solid transparent; /* Remove border, rely on shadow */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: none;
    padding-bottom: 0;
}

.widget-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.widget-actions {
    cursor: pointer;
    color: #a0aec0;
    transition: color 0.2s;
    padding: 4px;
    border-radius: 50%;
}

.widget-actions:hover {
    color: #4a5568;
    background-color: #edf2f7;
}

.service-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    color: var(--link-color);
    cursor: pointer;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
    margin-bottom: 4px;
}

.service-link:hover {
    background-color: #ebf8ff;
}

.service-link:hover .service-name {
    text-decoration: none;
}

.service-name {
    font-weight: 500;
    font-size: 15px;
}

.service-icon {
    font-weight: bold;
    color: #ffffff;
    padding: 0;
    border-radius: var(--radius-md);
    font-size: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.service-icon.ec2 { background-color: #d13212; }
.service-icon.s3 { background-color: #3b8132; }
.service-icon.rds { background-color: #3b48cc; }
.service-icon.iam { background-color: #cc2264; }
.service-icon.vpc { background-color: #8c4f9f; }

.text-green { color: #1d8102; }
.text-orange { color: #ec7211; }

/* Health Widget */
.health-status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.health-item {
    display: flex;
    flex-direction: column;
}

.health-label {
    font-size: 12px;
    color: #545b64;
}

.health-value {
    font-size: 20px;
    font-weight: 300;
}

.health-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #16191f;
}

/* Cost Widget */
.cost-amount {
    font-size: 32px;
    font-weight: 300;
    display: block;
    margin-bottom: 4px;
}

.cost-label, .forecast-label {
    font-size: 12px;
    color: #545b64;
}

.cost-forecast {
    margin-top: 12px;
    display: flex;
    gap: 4px;
    align-items: baseline;
}

.forecast-amount {
    font-weight: 700;
}

.cost-chart-placeholder {
    height: 100px;
    margin-top: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-bottom: 1px solid #eaeded;
    padding-bottom: 4px;
}

.chart-bar {
    flex: 1;
    background-color: #0073bb;
    opacity: 0.7;
}

/* Solution Widget */
.solution-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.solution-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
}

.solution-links a:hover {
    text-decoration: underline;
}

/* Advisor Widget */
.advisor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eaeded;
}

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

/* Table Styles */
.widget-content table {
    width: 100%;
    border-collapse: collapse;
}

.widget-content thead {
    background-color: #f7fafc;
    border-bottom: 2px solid var(--border-color);
}

.widget-content thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.widget-content tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.widget-content tbody tr:hover {
    background-color: #f7fafc;
}

.widget-content tbody td {
    padding: 16px;
    font-size: 14px;
    color: var(--text-color);
}

.widget-content tbody td code {
    background-color: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #2d3748;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Empty State */
.widget-content .empty-state {
    text-align: center;
    padding: 48px 24px;
}

.widget-content .empty-state-icon {
    margin-bottom: 16px;
}

.widget-content .empty-state-icon i,
.widget-content .empty-state-icon span {
    font-size: 48px;
    color: #a0aec0;
}

.widget-content .empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.widget-content .empty-state-description {
    font-size: 14px;
    color: #718096;
    margin-bottom: 24px;
}

.widget-content .empty-state button,
.widget-content .empty-state .btn-customize {
    background-color: var(--link-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.widget-content .empty-state button:hover,
.widget-content .empty-state .btn-customize:hover {
    background-color: #023a2a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Footer */
.aws-footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #545b64;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #545b64;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-copyright {
    color: #718096;
}

/* S3 Action Dropdown - Prevent scrolling */
.widget-content table tbody td {
    overflow: visible !important;
}

.widget-content table tbody td > div[style*="position: relative"] {
    overflow: visible !important;
}

/* Media Library Cards */
.media-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.media-library-card {
    position: relative;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.media-library-card:hover {
    border-color: var(--link-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.media-library-card:hover .media-library-actions {
    opacity: 1 !important;
}

.media-library-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.media-library-actions button {
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.media-library-actions button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.media-library-actions button.edit-btn:hover {
    background-color: #f7fafc;
    border-color: var(--link-color);
}

.media-library-actions button.delete-btn:hover {
    background-color: #fed7d7;
    border-color: #e53e3e;
}

.media-library-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
}

.media-library-icon.videos { background-color: #bee3f8; color: #2c5282; }
.media-library-icon.audios { background-color: #e9d8fd; color: #553c9a; }
.media-library-icon.images { background-color: #c6f6d5; color: #22543d; }
.media-library-icon.default { background-color: #edf2f7; color: #4a5568; }

.media-library-content {
    flex: 1;
    min-width: 0;
}

.media-library-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-library-meta {
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge-info {
    background-color: #bee3f8;
    color: #2c5282;
}

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

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

.form-label .required {
    color: #e53e3e;
    margin-left: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-color);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(2, 68, 48, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #a0aec0;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: #edf2f7;
    color: #718096;
    cursor: not-allowed;
    opacity: 0.75;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help-text {
    font-size: 12px;
    color: #718096;
    margin-top: 6px;
    display: block;
}

.form-error {
    font-size: 13px;
    color: #e53e3e;
    margin-top: 6px;
    display: block;
}

.form-error-list {
    background-color: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 20px;
}

.form-error-list p {
    color: #742a2a;
    font-size: 13px;
    margin: 0;
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--link-color);
}

.form-checkbox-label,
.form-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    margin-bottom: 0;
}

.form-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-checkbox-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-actions.left {
    justify-content: flex-start;
}

.form-actions.center {
    justify-content: center;
}

.form-actions.space-between {
    justify-content: space-between;
}

.btn-primary {
    background-color: var(--link-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-primary:hover {
    background-color: #023a2a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 68, 48, 0.2);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background-color: #e53e3e;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background-color: #c53030;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Form Field Groups */
.form-field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

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

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

/* Tabs */
.tabs-container {
    display: flex;
    gap: 4px;
    padding: 4px;
    background-color: #f7fafc;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    background-color: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    background-color: #edf2f7;
    color: var(--text-color);
}

.tab-button.active {
    background-color: #ffffff;
    color: var(--link-color);
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--link-color);
    border-radius: 2px 2px 0 0;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Sidebar Navigation for Detail Pages */
.detail-sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.detail-sidebar-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.detail-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.detail-sidebar-subtitle {
    font-size: 12px;
    color: #718096;
}

.detail-nav-group {
    margin-bottom: 24px;
}

.detail-nav-group-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 2px;
    text-decoration: none;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
}

.detail-nav-item:hover {
    background-color: #edf2f7;
    color: #1a202c;
}

.detail-nav-item.active {
    background-color: #ebf8ff;
    color: var(--link-color);
    font-weight: 600;
}

.detail-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.detail-nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background-color: #ebf8ff;
    color: var(--link-color);
}

.detail-sidebar-stats {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.detail-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
}

.detail-stat-label {
    color: #718096;
}

.detail-stat-value {
    font-weight: 600;
    color: var(--text-color);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-card:hover {
    border-color: var(--link-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.video-card:hover .media-library-actions {
    opacity: 1 !important;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail i {
    font-size: 48px;
    color: #a0aec0;
}

.video-card-content {
    padding: 16px;
}

.video-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.video-meta-row {
    display: flex;
    justify-content: space-between;
    color: #718096;
}

.video-meta-value {
    font-weight: 500;
    color: var(--text-color);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    background-color: #f7fafc;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--link-color);
    background-color: #ebf8ff;
}

.upload-zone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background-color: #bee3f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone-icon i {
    font-size: 32px;
    color: #2c5282;
}

.upload-zone-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.upload-zone-description {
    font-size: 14px;
    color: #718096;
    margin-bottom: 4px;
}

.upload-zone-hint {
    font-size: 12px;
    color: #a0aec0;
}

/* Modal Styles */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-container.hidden {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.modal-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-content-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.modal-content-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

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

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    font-size: 18px;
    padding: 8px;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 56px; /* Below header */
        left: 0;
        height: calc(100vh - 56px);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: var(--shadow-md);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .header-center {
        display: none; /* Hide search on tablet/mobile for simplicity, or make it an icon */
    }

    .content-wrapper {
        padding: 16px;
    }

    .dashboard-widgets {
        grid-template-columns: 1fr; /* Stack widgets */
    }
    
    .nav-item span {
        display: none; /* Hide text in header icons on mobile */
    }
    
    .nav-item.user-menu span, .nav-item.region-menu span {
        display: none;
    }
}

/* Video Detail Page Layout */
.video-detail-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

@media (max-width: 1024px) {
    .video-detail-layout {
        grid-template-columns: 1fr;
    }
}

/* S3 Detail Page Responsive Layout */
@media (max-width: 1024px) {
    .s3-detail-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .aws-header {
        padding: 0 12px;
    }
    
    .logo-text-wrapper {
        gap: 1px;
    }
    
    .logo-container i.fa-fencode {
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    .logo-arrow {
        width: 80px;
        height: 10px;
        stroke-width: 2;
    }
    
    /* Notification Dropdown Styles */
    .notification-dropdown {
        position: relative;
    }
    
    .notification-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background-color: #e53e3e;
        color: #ffffff;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: 600;
        min-width: 18px;
        z-index: 1;
    }
    
    .notification-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 400px;
        max-width: 90vw;
        background-color: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        max-height: 600px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .notification-item {
        transition: background-color 0.15s;
    }
    
    .notification-item.unread {
        background-color: #fef2f2;
    }
    
    /* Notification Dropdown Scrollbar */
    .notification-dropdown-menu > div[style*="overflow-y: auto"] {
        scrollbar-width: thin;
        scrollbar-color: #cbd5e0 #f9fafb;
    }
    
    .notification-dropdown-menu > div[style*="overflow-y: auto"]::-webkit-scrollbar {
        width: 8px;
    }
    
    .notification-dropdown-menu > div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
        background: #f9fafb;
        border-radius: 4px;
    }
    
    .notification-dropdown-menu > div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 4px;
    }
    
    .notification-dropdown-menu > div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }
    
    /* User Dropdown Styles */
    .user-dropdown {
        position: relative;
    }
    
    .user-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 280px;
        max-width: 90vw;
        background-color: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        overflow: hidden;
    }
    
    .user-menu-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        color: #111827;
        text-decoration: none;
        font-size: 13px;
        transition: background-color 0.15s;
    }
    
    .user-menu-item:hover {
        background-color: #f9fafb;
    }
    
    .header-right .nav-item:not(.user-menu):not(.notification-bell) {
        display: none; /* Hide extra icons on very small screens, but keep notification bell */
    }
    
    .notification-dropdown-menu {
        width: calc(100vw - 24px);
        max-width: 360px;
        right: -12px;
    }
    
    /* Search Autocomplete Mobile */
    .search-autocomplete {
        max-width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        width: auto;
    }
}

/* Authentication Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: var(--bg-color);
}

.auth-content {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    max-width: 170px;
    height: auto;
}

.auth-card {
    background-color: var(--widget-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-card-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.auth-card-description {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
    margin-bottom: 4px;
}

.auth-form .btn-primary {
    margin-top: 4px;
}

.auth-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #023a2a;
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    height: 44px;
    justify-content: center;
}

.auth-submit span {
    display: inline-block;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    padding: 0 16px;
    font-size: 14px;
    color: #718096;
}

.auth-social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    height: 44px;
    width: 100%;
}

.btn-social:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-social:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-social i {
    font-size: 18px;
    flex-shrink: 0;
}

.btn-social span {
    flex: 1;
    text-align: center;
}

.btn-github {
    color: #24292e;
}

.btn-github:hover {
    background-color: #f6f8fa;
    border-color: #d1d5db;
}

.btn-linkedin {
    color: #0077b5;
}

.btn-linkedin:hover {
    background-color: #f0f7fa;
    border-color: #0077b5;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #718096;
}

.auth-footer p {
    margin: 0;
}

/* Alert Messages */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert i {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert > div {
    flex: 1;
}

.alert > div h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.alert > div p {
    margin: 0;
}

.alert-success {
    background-color: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.alert-success i {
    color: #22543d;
}

.alert-warning {
    background-color: #fefcbf;
    border: 1px solid #f6e05e;
    color: #744210;
}

.alert-warning i {
    color: #744210;
}

.alert-error {
    background-color: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
}

.alert-error i {
    color: #742a2a;
}

.alert-info {
    background-color: #bee3f8;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

.alert-info i {
    color: #2c5282;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .auth-card-header h2 {
        font-size: 20px;
    }
}

/* Page Loading Spinner */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.page-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner-circle {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--link-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}
