/* PDF Stamper - Fortepiano.me Theme Replica */

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

:root {
    /* Extracted Colors from Screenshot */
    --nav-bg: #4A76A8; /* Slate blue from top bar */
    --page-bg: #E9EBEE; /* Light gray background */
    --card-bg: #FFFFFF;
    
    --primary-blue: #2563EB; /* Bright blue for buttons */
    --primary-blue-hover: #1D4ED8;
    
    /* "Available Songs" Bar colors */
    --header-bar-bg: #E3F2FD; 
    --header-bar-text: #1565C0;
    --header-bar-border: #BBDEFB;
    
    /* Text Colors */
    --text-main: #1F2937;
    --text-muted: #64748B;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--page-bg);
}

/* Navigation - Matches the dark blue top bar */
.top-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 0 20px;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-nav-brand { 
    font-size: 18px; 
    font-weight: 700; 
    color: white; 
    line-height: 50px; 
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.top-nav-links { 
    display: flex; 
    gap: 4px; 
    align-items: center; 
    height: 100%;
}

.top-nav-links a {
    padding: 6px 12px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
    background: transparent;
}

.top-nav-links a:hover { 
    background: rgba(255,255,255,0.1); 
    color: white; 
}

.top-nav-links a.active { 
    background: rgba(0,0,0,0.2); 
    color: white; 
}

.user-info {
    padding: 4px 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    font-size: 13px;
    color: white;
    font-weight: 500;
    margin-right: 8px;
}

/* Container */
.container { 
    max-width: 960px; 
    margin: 30px auto; 
    padding: 0 20px; 
}

/* Header - Matches the clean "Piano Arrangements" text */
.header { 
    text-align: left; 
    margin-bottom: 25px; 
    padding-left: 5px;
}
.header h1 { 
    font-size: 32px; 
    font-weight: 400; /* Lighter weight as seen in screenshot */
    color: #111; 
    margin-bottom: 5px; 
}
.header p { 
    font-size: 16px; 
    color: var(--text-muted); 
    margin: 0; 
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    margin-bottom: 25px;
}

/* Section Headers - Mimics the Blue/Green Bars in screenshot */
.card h2 { 
    font-size: 18px; 
    margin-bottom: 20px; 
    color: var(--header-bar-text);
    background-color: var(--header-bar-bg);
    border: 1px solid var(--header-bar-border);
    padding: 12px 20px;
    border-radius: 6px;
    display: block;
    font-weight: 700;
    /* Icon simulation */
    display: flex;
    align-items: center;
}

/* Optional: Add a musical note icon before headers via CSS */
.card h2::before {
    content: "🎵";
    margin-right: 10px;
    font-size: 16px;
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 32px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
    margin-left: 4px;
}
small { display: block; font-size: 13px; color: #94A3B8; margin-top: 6px; margin-left: 4px; }

/* Inputs - Pill shape like the Search Bar */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 20px; /* More horizontal padding for pill shape */
    font-size: 15px;
    font-family: inherit;
    color: #333;
    background: #F9FAFB;
    border: 1px solid #D1D5DB;
    border-radius: 50px; /* High radius for pill shape */
    transition: all 0.2s;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

/* File input needs less radius to look normal */
input[type="file"] {
    border-radius: 12px;
    padding: 8px 12px;
    background: white;
}

textarea { 
    border-radius: 15px; /* Softer corners for text area */
    resize: vertical; 
    min-height: 120px; 
}

input:hover, select:hover, textarea:hover { border-color: #9CA3AF; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary-blue); margin-right: 8px; }

/* Range Slider */
input[type="range"] {
    border-radius: 10px;
    height: 6px;
    padding: 0;
}
.range-group { display: flex; align-items: center; gap: 16px; padding: 0 10px; }
.opacity-value { font-weight: 700; color: var(--primary-blue); }

/* Buttons - Matches "Add" button style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { 
    background: var(--primary-blue); 
    color: white; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary:hover { 
    background: var(--primary-blue-hover); 
    transform: translateY(-1px); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.15); 
}
.btn-secondary { 
    background: white; 
    color: #555; 
    border: 1px solid #D1D5DB; 
}
.btn-secondary:hover { 
    background: #F3F4F6; 
    color: #111; 
    border-color: #9CA3AF;
}

/* Submit Button - Specific style */
button[type="submit"] {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px; /* Slightly less rounded than inputs */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
    margin-top: 10px;
}
button[type="submit"]:hover { 
    background: var(--primary-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15); 
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid transparent;
    font-size: 14px;
    display: none;
}
.alert.show { display: block; }
.alert.success { background: #D1FAE5; border-color: #A7F3D0; color: #065F46; }
.alert.error { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }

/* Loading */
.loading { 
    display: none; 
    text-align: center; 
    padding: 20px; 
    color: var(--primary-blue); 
    font-weight: 600;
    background: #EFF6FF;
    border-radius: 8px;
    margin-bottom: 20px;
}
.loading.show { display: block; }

/* Stats */
.stat-value { font-size: 36px; font-weight: 700; color: #333; line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: 13px; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E5E7EB;
}
.table thead { 
    background: #F9FAFB; 
    border-bottom: 2px solid #E5E7EB;
}
.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    text-transform: uppercase;
}
.table td { 
    padding: 14px 16px; 
    color: #4B5563; 
    border-bottom: 1px solid #F3F4F6; 
    font-size: 14px;
}
.table tbody tr:hover { background: #F9FAFB; }

/* Tabs */
.tabs { display: flex; gap: 5px; border-bottom: 1px solid #E5E7EB; margin-bottom: 25px; }
.tab {
    padding: 10px 20px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    font-size: 14px;
}
.tab:hover { color: var(--primary-blue); background: #F9FAFB; }
.tab.active { 
    color: var(--primary-blue); 
    border-bottom-color: var(--primary-blue); 
    background: white;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}
.badge-success { background: #D1FAE5; color: #059669; }
.badge-error { background: #FEE2E2; color: #DC2626; }
.feature-badge {
    background: #DBEAFE;
    color: #1E40AF;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    border: 1px solid #BFDBFE;
}

/* Buy Credits Page - Grid Fixes */
.packages-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 20px !important;
    margin: 30px 0 !important;
}

.package-card {
    background: white !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    padding: 25px 20px !important;
    text-align: center !important;
    position: relative !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.package-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1) !important;
    border-color: var(--primary-blue) !important;
}

.package-card.popular {
    border: 2px solid var(--primary-blue) !important;
    background: #EFF6FF !important;
}

.package-card.popular::before {
    content: "BEST VALUE" !important; /* Changed to match common ecommerce style */
    position: absolute !important;
    top: -12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: var(--primary-blue) !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}

.package-credits {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #111 !important;
    margin-bottom: 5px !important;
}

.package-credits-label {
    font-size: 13px !important;
    color: #6B7280 !important;
    margin-bottom: 15px !important;
    text-transform: uppercase;
}

.package-price {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--primary-blue) !important;
    margin-bottom: 5px !important;
}

.package-button {
    width: 100% !important;
    padding: 10px !important;
    background: var(--primary-blue) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
}

.credit-balance-card {
    background: white !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 0 auto 30px !important;
    max-width: 400px !important;
    text-align: center !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

/* Utilities */
.text-center { text-align: center; }
.hidden { display: none !important; }
a { color: var(--primary-blue); text-decoration: none; }
a:hover { color: var(--primary-blue-hover); text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .top-nav { height: auto; padding: 10px 20px; flex-direction: column; }
    .top-nav-brand { line-height: 1.5; margin-bottom: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .header-actions { flex-direction: column; }
    .header-actions .btn { width: 100%; margin-bottom: 10px; }
}