/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4f17a8 0%, #fe5b0b 100%);
    min-height: 100vh;
    color: #333;
}

/* Header Styles - Reduced Height */
.main-header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pmi-logo {
    width: 150px;
    height: 80px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4f17a8 0%, #fe5b0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.main-nav {
    flex-shrink: 0;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.3rem 0;
    position: relative;
    white-space: nowrap;
    font-size: 0.95rem;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #4f17a8 0%, #fe5b0b 100%);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: #4f17a8;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4f17a8;
    background: none;
    border: none;
    padding: 8px;
    flex-shrink: 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 2rem 2rem;
    color: white;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-section p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem 3rem;
}

.container {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Controls Panel */
.controls {
    flex: 1;
    min-width: 350px;
}

.control-card {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.card-header i {
    font-size: 1.5rem;
    color: #4f17a8;
}

.card-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

.input-group label i {
    color: #4f17a8;
}

.file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #4f17a8;
    background: #f5f3ff;
}

.input-group small {
    display: block;
    margin-top: 0.5rem;
    color: #999;
    font-size: 0.75rem;
}

.text-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #4f17a8;
    box-shadow: 0 0 0 3px rgba(79, 23, 168, 0.1);
}

.crop-container {
    width: 100%;
    height: 300px;
    margin: 1rem 0;
    background: #1a1a2e;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.crop-container img {
    max-width: 100%;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4f17a8 0%, #fe5b0b 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 23, 168, 0.3);
}

.btn-download {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(17, 153, 142, 0.3);
}

/* Preview Area */
.preview-area {
    flex: 1;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-label {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px 20px;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #4f17a8;
    backdrop-filter: blur(10px);
}

/* Badge Container */
#badge {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.3);
}

.bg {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    object-fit: cover;
}

/* Fixed positioning based on 600px badge */
.photo-area {
    position: absolute;
    width: 235px;
    height: 235px;
    border-radius: 50%;
    overflow: hidden;
    top: 315px;
    left: 443px;
    transform: translate(-50%, -50%);
    border: 4px #0080a8;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#badgeName {
    position: absolute;
    width: 210px;
    left: 444px;
    top: 456px;
    transform: translateX(-50%);
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: rgb(10, 10, 10);
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
}

/* Footer */
.main-footer {
    background: #1a1a2e;
    color: #eee;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem 1rem;
}

.footer-section {
    text-align: center;
    margin-bottom: 1rem;
}

.footer-contact {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

.footer-contact i {
    color: #fe5b0b;
    margin-right: 5px;
}

.social-section {
    margin: 1rem 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
}

.social-icon.linkedin {
    background: #0077b5;
}

.social-icon.instagram {
    background: radial-gradient(circle at 30% 110%, #fdf497, #fdf497, #fd5949, #d6249f, #285aeb);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #888;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    .header-container {
        padding: 0.5rem 4rem;
    }
    
    .main-content {
        padding: 0 4rem 3rem;
    }
    
    .footer-container {
        padding: 2rem 4rem 1rem;
    }
}

/* Desktop (1025px to 1399px) */
@media (min-width: 1025px) and (max-width: 1399px) {
    .header-container {
        padding: 0.5rem 3rem;
    }
    
    .main-content {
        padding: 0 3rem 3rem;
    }
    
    .footer-container {
        padding: 2rem 3rem 1rem;
    }
}

/* Tablet Landscape (769px to 1024px) */
@media (max-width: 1024px) {
    .header-container {
        padding: 0.4rem 2rem;
    }
    
    .main-content {
        padding: 0 2rem 2.5rem;
    }
    
    .footer-container {
        padding: 1.5rem 2rem 1rem;
    }
    
    .pmi-logo {
        width: 80px;
        height: 50px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .main-nav ul {
        gap: 1.5rem;
    }
    
    .main-nav ul li a {
        font-size: 0.9rem;
    }
    
    #badge {
        width: 500px;
        height: 500px;
    }
    
    .photo-area {
        width: 195px;
        height: 195px;
        top: 280px;
        left: 369px;
    }
    
    #badgeName {
        width: 175px;
        left: 370px;
        top: 380px;
        font-size: 13px;
    }
}

/* Tablet Portrait (577px to 768px) */
@media (max-width: 768px) {
    .header-container {
        padding: 0.4rem 1.5rem;
    }
    
    .main-content {
        padding: 0 1.5rem 2rem;
    }
    
    .footer-container {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .pmi-logo {
        width: 45px;
        height: 45px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .main-nav ul li a {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .container {
        gap: 1.5rem;
        flex-direction: column;
        align-items: center;
    }
    
    .controls {
        min-width: auto;
        width: 100%;
        max-width: 500px;
    }
    
    .preview-area {
        min-width: auto;
        width: 100%;
    }
    
    .control-card {
        padding: 1.5rem;
    }
    
    #badge {
        width: 450px;
        height: 450px;
    }
    
    .photo-area {
        width: 175.5px;
        height: 175.5px;
        top: 252px;
        left: 332px;
        border-width: 3px;
    }
    
    #badgeName {
        width: 157.5px;
        left: 333px;
        top: 342px;
        font-size: 12px;
    }
}

/* Mobile (481px to 576px) */
@media (max-width: 576px) {
    .header-container {
        padding: 0.3rem 1.25rem;
    }
    
    .main-content {
        padding: 0 1.25rem 1.5rem;
    }
    
    .footer-container {
        padding: 1.25rem 1.25rem 0.75rem;
    }
    
    .logo-text {
        font-size: 0.85rem;
    }
    
    .pmi-logo {
        width: 60px;
        height: 40px;
    }
    
    /* Hide desktop menu, show mobile button */
    .main-nav ul {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    /* Mobile menu dropdown */
    .main-nav ul.show {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        gap: 0.75rem;
    }
    
    .main-nav ul.show li a {
        display: block;
        padding: 0.5rem;
        text-align: center;
    }
    
    .hero-section {
        padding: 1.5rem 1rem 1.25rem;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.9rem;
    }
    
    .control-card {
        padding: 1rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    #badge {
        width: 350px;
        height: 350px;
    }
    
    .photo-area {
        width: 136.5px;
        height: 136.5px;
        top: 196px;
        left: 258.5px;
        border-width: 2.5px;
    }
    
    #badgeName {
        width: 122.5px;
        left: 259px;
        top: 266px;
        font-size: 10px;
    }
    
    .footer-contact {
        font-size: 0.7rem;
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Small Mobile (380px to 480px) */
@media (max-width: 480px) {
    .header-container {
        padding: 0.3rem 1rem;
    }
    
    .main-content {
        padding: 0 1rem 1.5rem;
    }
    
    .footer-container {
        padding: 1rem 1rem 0.75rem;
    }
    
    .logo-text {
        font-size: 0.75rem;
    }
    
    .pmi-logo {
        width: 45px;
        height: 35px;
    }
    
    .mobile-menu-btn {
        font-size: 1.2rem;
        padding: 5px;
    }
    
    .hero-section h1 {
        font-size: 1.3rem;
    }
    
    #badge {
        width: 300px;
        height: 300px;
    }
    
    .photo-area {
        width: 117px;
        height: 117px;
        top: 168px;
        left: 221.5px;
        border-width: 2px;
    }
    
    #badgeName {
        width: 105px;
        left: 222px;
        top: 228px;
        font-size: 9px;
    }
}

/* Extra Small Mobile (up to 380px) */
@media (max-width: 380px) {
    .header-container {
        padding: 0.3rem 0.75rem;
    }
    
    .main-content {
        padding: 0 0.75rem 1.5rem;
    }
    
    .footer-container {
        padding: 0.75rem 0.75rem 0.5rem;
    }
    
    .logo-text {
        font-size: 0.7rem;
    }
    
    .pmi-logo {
        width: 35px;
        height: 30px;
    }
    
    .mobile-menu-btn {
        font-size: 1.1rem;
    }
    
    #badge {
        width: 280px;
        height: 280px;
    }
    
    .photo-area {
        width: 109.2px;
        height: 109.2px;
        top: 156.8px;
        left: 206.7px;
        border-width: 2px;
    }
    
    #badgeName {
        width: 98px;
        left: 207.2px;
        top: 212.8px;
        font-size: 8px;
    }
}